diff --git a/Marlin/src/Marlin.cpp b/Marlin/src/Marlin.cpp index 20f86304eaa9..68f37d2a7253 100644 --- a/Marlin/src/Marlin.cpp +++ b/Marlin/src/Marlin.cpp @@ -741,21 +741,12 @@ void idle( #endif } -// Kill heaters, job timer, and queue -void kill_activity() { - thermalManager.disable_all_heaters(); - stepper.quick_stop(); - //queue.stop(); - //print_job_timer.stop(); - //queue.clear(); -} - /** * Kill all activity and lock the machine. * After this the machine will need to be reset. */ -void kill(PGM_P const lcd_msg/*=nullptr*/) { - kill_activity(); +void kill(PGM_P const lcd_msg/*=nullptr*/, const bool steppers_off/*=false*/) { + thermalManager.disable_all_heaters(); SERIAL_ERROR_MSG(MSG_ERR_KILLED); @@ -769,10 +760,10 @@ void kill(PGM_P const lcd_msg/*=nullptr*/) { host_action_kill(); #endif - minkill(); + minkill(steppers_off); } -void minkill() { +void minkill(const bool steppers_off/*=false*/) { // Wait a short time (allows messages to get out before shutting down. for (int i = 1000; i--;) DELAY_US(600); @@ -782,7 +773,11 @@ void minkill() { // Wait to ensure all interrupts stopped for (int i = 1000; i--;) DELAY_US(250); - kill_activity(); + // Reiterate heaters off + thermalManager.disable_all_heaters(); + + // Power off all steppers (for M112) or just the E steppers + steppers_off ? disable_all_steppers() : disable_e_steppers(); #if HAS_POWER_SWITCH PSU_OFF(); diff --git a/Marlin/src/Marlin.h b/Marlin/src/Marlin.h index db24382bc8d2..1a9acc007582 100644 --- a/Marlin/src/Marlin.h +++ b/Marlin/src/Marlin.h @@ -322,8 +322,8 @@ void disable_e_stepper(const uint8_t e); void disable_e_steppers(); void disable_all_steppers(); -void kill(PGM_P const lcd_msg=nullptr); -void minkill(); +void kill(PGM_P const lcd_msg=nullptr, const bool steppers_off=false); +void minkill(const bool steppers_off=false); void quickstop_stepper(); diff --git a/Marlin/src/gcode/control/M108_M112_M410.cpp b/Marlin/src/gcode/control/M108_M112_M410.cpp index 4668c6904ed4..9b6193bd9309 100644 --- a/Marlin/src/gcode/control/M108_M112_M410.cpp +++ b/Marlin/src/gcode/control/M108_M112_M410.cpp @@ -41,7 +41,7 @@ void GcodeSuite::M108() { * M112: Full Shutdown */ void GcodeSuite::M112() { - kill(PSTR("M112 Shutdown")); + kill(PSTR("M112 Shutdown"), true); } /**