From 6da949bbf080db1120375612695eb22572d82e2b Mon Sep 17 00:00:00 2001 From: rafaljot Date: Tue, 21 Mar 2017 15:06:01 +0100 Subject: [PATCH] Update Marlin_main.cpp Sometimes after killing heaters are still on. --- Marlin/Marlin_main.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 7d5cf729a..ffee8c387 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -10584,17 +10584,20 @@ void kill(const char* lcd_msg) { SERIAL_ERROR_START; SERIAL_ERRORLNPGM(MSG_ERR_KILLED); + thermalManager.disable_all_heaters(); + disable_all_steppers(); + #if ENABLED(ULTRA_LCD) kill_screen(lcd_msg); #else UNUSED(lcd_msg); #endif - delay(500); // Wait a short time - + _delay_ms(250); // Wait a short time cli(); // Stop interrupts - thermalManager.disable_all_heaters(); - disable_all_steppers(); + + _delay_ms(250); //Wait to ensure all interrupts routines stopped + thermalManager.disable_all_heaters(); //turn off heaters again #if HAS_POWER_SWITCH SET_INPUT(PS_ON_PIN);