Merge Implement M110 (PR#2327)

master
Richard Wackerbarth 10 years ago
commit 47b78ed1af

@ -138,6 +138,7 @@
* M109 - Sxxx Wait for extruder current temp to reach target temp. Waits only when heating * M109 - Sxxx Wait for extruder current temp to reach target temp. Waits only when heating
* Rxxx Wait for extruder current temp to reach target temp. Waits when heating and cooling * Rxxx Wait for extruder current temp to reach target temp. Waits when heating and cooling
* IF AUTOTEMP is enabled, S<mintemp> B<maxtemp> F<factor>. Exit autotemp by any M109 without F * IF AUTOTEMP is enabled, S<mintemp> B<maxtemp> F<factor>. Exit autotemp by any M109 without F
* M110 - Set the current line number
* M111 - Set debug flags with S<mask>. See flag bits defined in Marlin.h. * M111 - Set debug flags with S<mask>. See flag bits defined in Marlin.h.
* M112 - Emergency stop * M112 - Emergency stop
* M114 - Output current position to serial port * M114 - Output current position to serial port
@ -791,8 +792,17 @@ void get_command() {
char *npos = strchr(command, 'N'); char *npos = strchr(command, 'N');
char *apos = strchr(command, '*'); char *apos = strchr(command, '*');
if (npos) { if (npos) {
boolean M110 = strstr_P(command, PSTR("M110")) != NULL;
if (M110) {
char *n2pos = strchr(command + 4, 'N');
if (n2pos) npos = n2pos;
}
gcode_N = strtol(npos + 1, NULL, 10); gcode_N = strtol(npos + 1, NULL, 10);
if (gcode_N != gcode_LastN + 1 && strstr_P(command, PSTR("M110")) == NULL) {
if (gcode_N != gcode_LastN + 1 && !M110) {
gcode_line_error(PSTR(MSG_ERR_LINE_NO)); gcode_line_error(PSTR(MSG_ERR_LINE_NO));
return; return;
} }
@ -807,7 +817,7 @@ void get_command() {
} }
// if no errors, continue parsing // if no errors, continue parsing
} }
else { else if (npos == command) {
gcode_line_error(PSTR(MSG_ERR_NO_CHECKSUM)); gcode_line_error(PSTR(MSG_ERR_NO_CHECKSUM));
return; return;
} }

Loading…
Cancel
Save