Browse Source

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.
Yuri D'Elia 2 years ago
parent
commit
a588a5f695
1 changed files with 6 additions and 1 deletions
  1. 6 1
      Firmware/cmdqueue.cpp

+ 6 - 1
Firmware/cmdqueue.cpp

@@ -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