Forráskód Böngészése

TM: Clear the Stopped state when stopping the current print

We allow resuming from the LCD via start print and resume print,
it makes sense to clear the error on stop too.

For this reason distinguish whether the action is performed
automatically or manually (ie: interactively).

The error is only cleared when the command is run interactively.
Yuri D'Elia 2 éve
szülő
commit
6e2f016655
3 módosított fájl, 16 hozzáadás és 5 törlés
  1. 3 3
      Firmware/Marlin_main.cpp
  2. 11 1
      Firmware/ultralcd.cpp
  3. 2 1
      Firmware/ultralcd.h

+ 3 - 3
Firmware/Marlin_main.cpp

@@ -666,7 +666,7 @@ void crashdet_cancel()
 	saved_printing = false;
 	tmc2130_sg_stop_on_crash = true;
 	if (saved_printing_type == PRINTING_TYPE_SD) {
-		lcd_print_stop();
+		print_stop();
 	}else if(saved_printing_type == PRINTING_TYPE_USB){
 		SERIAL_ECHOLNRPGM(MSG_OCTOPRINT_CANCEL); //for Octoprint: works the same as clicking "Abort" button in Octoprint GUI
 		cmdqueue_reset();
@@ -7848,7 +7848,7 @@ Sigma_Exit:
     ### M603 - Stop print <a href="https://reprap.org/wiki/G-code#M603:_Stop_print">M603: Stop print</a>
     */
     case 603: {
-        lcd_print_stop();
+        print_stop();
     }
     break;
 
@@ -9611,7 +9611,7 @@ void ThermalStop(bool allow_pause)
             }
         } else {
             // We got a hard thermal error and/or there is no print going on. Just stop.
-            lcd_print_stop();
+            print_stop();
         }
 
         // Report the status on the serial, switch to a busy state

+ 11 - 1
Firmware/ultralcd.cpp

@@ -5906,7 +5906,7 @@ void lcd_print_stop_finish()
     axis_relative_modes = E_AXIS_MASK; //XYZ absolute, E relative
 }
 
-void lcd_print_stop()
+void print_stop(bool interactive)
 {
     // UnconditionalStop() will internally cause planner_abort_hard(), meaning we _cannot_ plan any
     // more move in this call! Any further move must happen inside lcd_print_stop_finish(), which is
@@ -5925,11 +5925,21 @@ void lcd_print_stop()
     pause_time = 0;
     isPrintPaused = false;
 
+    if (interactive) {
+        // acknowledged by the user from the LCD: resume processing USB commands again
+        Stopped = false;
+    }
+
     // return to status is required to continue processing in the main loop!
     lcd_commands_type = LcdCommands::StopPrint;
     lcd_return_to_status();
 }
 
+void lcd_print_stop()
+{
+    print_stop(true);
+}
+
 #ifdef TEMP_MODEL
 void lcd_temp_model_cal()
 {

+ 2 - 1
Firmware/ultralcd.h

@@ -46,7 +46,8 @@ void lcd_sdcard_stop();
 void lcd_pause_print();
 void lcd_pause_usb_print();
 void lcd_resume_print();
-void lcd_print_stop();
+void lcd_print_stop(); // interactive print stop
+void print_stop(bool interactive=false);
 #ifdef TEMP_MODEL
 void lcd_temp_model_cal();
 #endif //TEMP_MODEL