Merge pull request #27 from AndreeeCZ/MK2

main: ignore handling of 'N' symbols (line number) when dealing with special PRUSA commands
This commit is contained in:
Michal Průša 2016-12-14 16:03:11 +01:00 committed by GitHub
commit e4b7219239
1 changed files with 47 additions and 45 deletions

View File

@ -1239,6 +1239,7 @@ void get_command()
cmdbuffer[bufindw+serial_count+1] = 0; //terminate string cmdbuffer[bufindw+serial_count+1] = 0; //terminate string
if(!comment_mode){ if(!comment_mode){
comment_mode = false; //for new command comment_mode = false; //for new command
if ((strchr_pointer = strstr(cmdbuffer+bufindw+1, "PRUSA")) == NULL && (strchr_pointer = strchr(cmdbuffer+bufindw+1, 'N')) != NULL) {
if ((strchr_pointer = strchr(cmdbuffer+bufindw+1, 'N')) != NULL) if ((strchr_pointer = strchr(cmdbuffer+bufindw+1, 'N')) != NULL)
{ {
// Line number met. When sending a G-code over a serial line, each line may be stamped with its index, // Line number met. When sending a G-code over a serial line, each line may be stamped with its index,
@ -1286,6 +1287,7 @@ void get_command()
gcode_LastN = gcode_N; gcode_LastN = gcode_N;
//if no errors, continue parsing //if no errors, continue parsing
} // end of 'N' command } // end of 'N' command
}
else // if we don't receive 'N' but still see '*' else // if we don't receive 'N' but still see '*'
{ {
if((strchr(cmdbuffer+bufindw+1, '*') != NULL)) if((strchr(cmdbuffer+bufindw+1, '*') != NULL))