Optimize emergency parser check

This commit is contained in:
Scott Lahteine 2020-11-25 22:28:42 -06:00
parent fc1deea2b8
commit 7c9c897dac

View File

@ -538,12 +538,11 @@ void GCodeQueue::get_serial_commands() {
#if DISABLED(EMERGENCY_PARSER) #if DISABLED(EMERGENCY_PARSER)
// Process critical commands early // Process critical commands early
if (strcmp_P(command, PSTR("M108")) == 0) { if (command[0] == 'M') switch (command[3]) {
wait_for_heatup = false; case '8': if (command[2] == '0' && command[1] == '1') { wait_for_heatup = false; TERN_(HAS_LCD_MENU, wait_for_user = false); } break;
TERN_(HAS_LCD_MENU, wait_for_user = false); case '2': if (command[2] == '1' && command[1] == '1') kill(M112_KILL_STR, nullptr, true); break;
case '0': if (command[1] == '4' && command[2] == '1') quickstop_stepper(); break;
} }
if (strcmp_P(command, PSTR("M112")) == 0) kill(M112_KILL_STR, nullptr, true);
if (strcmp_P(command, PSTR("M410")) == 0) quickstop_stepper();
#endif #endif
#if defined(NO_TIMEOUTS) && NO_TIMEOUTS > 0 #if defined(NO_TIMEOUTS) && NO_TIMEOUTS > 0