|
@@ -10154,6 +10154,31 @@ void kill(const char *full_screen_message, unsigned char id)
|
|
|
} // Wait for reset
|
|
|
}
|
|
|
|
|
|
+void UnconditionalStop()
|
|
|
+{
|
|
|
+ CRITICAL_SECTION_START;
|
|
|
+
|
|
|
+ // Disable all heaters and unroll the temperature wait loop stack
|
|
|
+ disable_heater();
|
|
|
+
|
|
|
+ // Clear any saved printing state
|
|
|
+ cancel_saved_printing();
|
|
|
+
|
|
|
+ // Abort the planner
|
|
|
+ planner_abort_hard();
|
|
|
+
|
|
|
+ // Reset the queue
|
|
|
+ cmdqueue_reset();
|
|
|
+ cmdqueue_serial_disabled = false;
|
|
|
+
|
|
|
+ // Reset the sd status
|
|
|
+ card.sdprinting = false;
|
|
|
+ card.closefile();
|
|
|
+
|
|
|
+ st_reset_timer();
|
|
|
+ CRITICAL_SECTION_END;
|
|
|
+}
|
|
|
+
|
|
|
// Stop: Emergency stop used by overtemp functions which allows recovery
|
|
|
//
|
|
|
// In addition to stopping the print, this prevents subsequent G[0-3] commands to be
|
|
@@ -10166,15 +10191,27 @@ void kill(const char *full_screen_message, unsigned char id)
|
|
|
// the addition of disabling the headers) could allow true recovery in the future.
|
|
|
void Stop()
|
|
|
{
|
|
|
+ // Keep disabling heaters
|
|
|
disable_heater();
|
|
|
+
|
|
|
+ // Call the regular stop function if that's the first time during a new print
|
|
|
if(Stopped == false) {
|
|
|
Stopped = true;
|
|
|
lcd_print_stop();
|
|
|
Stopped_gcode_LastN = gcode_LastN; // Save last g_code for restart
|
|
|
+
|
|
|
+ // Eventually report the stopped status (though this is usually overridden by a
|
|
|
+ // higher-priority alert status message)
|
|
|
SERIAL_ERROR_START;
|
|
|
SERIAL_ERRORLNRPGM(MSG_ERR_STOPPED);
|
|
|
LCD_MESSAGERPGM(_T(MSG_STOPPED));
|
|
|
}
|
|
|
+
|
|
|
+ // Return to the status screen to stop any pending menu action which could have been
|
|
|
+ // started by the user while stuck in the Stopped state. This also ensures the NEW
|
|
|
+ // error is immediately shown.
|
|
|
+ if (menu_menu != lcd_status_screen)
|
|
|
+ lcd_return_to_status();
|
|
|
}
|
|
|
|
|
|
bool IsStopped() { return Stopped; };
|