Browse Source

Remove duplicit incrementation of consecutive comment lines

It was left in the code in one of the refactoring/optimization passes.
It really didn't do any harm, but was limiting the performance of the
skipping algorithm.

+ some verification code added - will be removed after successful tests
D.R.racer 3 years ago
parent
commit
15d76a7501
1 changed files with 3 additions and 1 deletions
  1. 3 1
      Firmware/SdFile.cpp

+ 3 - 1
Firmware/SdFile.cpp

@@ -151,7 +151,9 @@ int16_t SdFile::readFilteredGcode(){
                 if( ! gfEnsureBlock() )goto eof_or_fail; // fetch it into RAM
                 rdPtr = start = blockBuffBegin;
             } else {
-                if(++consecutiveCommentLines == 255){
+                if(consecutiveCommentLines >= 250){
+//                    SERIAL_ECHO("ccl=");
+//                    SERIAL_ECHOLN((int)consecutiveCommentLines);
                     // SERIAL_PROTOCOLLN(sd->curPosition_);
                     --rdPtr; // unget the already consumed newline
                     goto emit_char;