Fix/implement M110 command. Allow colons in command - don't treat as EOL.

This commit is contained in:
Ted Hess 2017-06-29 14:12:35 -04:00
parent b3eeac124a
commit 5611852e1b
1 changed files with 6 additions and 2 deletions

View File

@ -1379,7 +1379,6 @@ void get_command()
continue; continue;
if(serial_char == '\n' || if(serial_char == '\n' ||
serial_char == '\r' || serial_char == '\r' ||
(serial_char == ':' && comment_mode == false) ||
serial_count >= (MAX_CMD_SIZE - 1) ) serial_count >= (MAX_CMD_SIZE - 1) )
{ {
if(!serial_count) { //if empty line if(!serial_count) { //if empty line
@ -1388,7 +1387,6 @@ 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
if ((strchr_pointer = strstr(cmdbuffer+bufindw+1, "PRUSA")) == NULL && (strchr_pointer = strchr(cmdbuffer+bufindw+1, 'N')) != NULL) { 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)
{ {
@ -4336,6 +4334,12 @@ Sigma_Exit:
} }
} }
break; break;
case 110: // M110 - reset line pos
if (code_seen('N'))
gcode_LastN = code_value_long();
else
gcode_LastN = 0;
break;
case 115: // M115 case 115: // M115
if (code_seen('V')) { if (code_seen('V')) {
// Report the Prusa version number. // Report the Prusa version number.