Allow M310 to bypass the Stopped state for recovery

Since M310 cannot change the heaters, allowing M310 S0 (and changing
parameters) allows to recover a usb-controlled printer which has been
locked-out due to bad model settings.
This commit is contained in:
Yuri D'Elia 2022-12-14 00:25:38 +01:00 committed by 3d-gussner
parent 42125b4bb2
commit 5ab0dcb4c5

View file

@ -438,11 +438,16 @@ void get_command()
if(strcmp_P(cmd_start, PSTR("M112")) == 0)
kill(MSG_M112_KILL, 2);
// Bypass Stopped for some commands
bool allow_when_stopped = false;
if(strncmp_P(cmd_start, PSTR("M310"), 4) == 0)
allow_when_stopped = true;
// Handle the USB timer
if ((*cmd_start == 'G') && !IS_SD_PRINTING)
usb_timer.start();
if (Stopped == true) {
if (allow_when_stopped == false && Stopped == true) {
// Stopped can be set either during error states (thermal error: cannot continue), or
// when a printer-initiated action is processed. In such case the printer will send to
// the host an action, but cannot know if the action has been processed while new