Disable steppers on M112 (#15065)

And change verbiage to not refer to "Emergency Stop."
This commit is contained in:
InsanityAutomation
2019-08-28 01:51:01 -04:00
committed by Scott Lahteine
parent 318356b6bc
commit b7796bcce6
7 changed files with 17 additions and 13 deletions

View File

@@ -745,7 +745,7 @@ void idle(
* Kill all activity and lock the machine.
* After this the machine will need to be reset.
*/
void kill(PGM_P const lcd_msg/*=nullptr*/) {
void kill(PGM_P const lcd_msg/*=nullptr*/, const bool steppers_off/*=false*/) {
thermalManager.disable_all_heaters();
SERIAL_ERROR_MSG(MSG_ERR_KILLED);
@@ -760,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);
@@ -773,7 +773,11 @@ void minkill() {
// Wait to ensure all interrupts stopped
for (int i = 1000; i--;) DELAY_US(250);
thermalManager.disable_all_heaters(); // turn off heaters again
// 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();