Browse Source

Update Marlin_main.cpp

Sometimes after killing heaters are still on.
rafaljot 8 years ago
parent
commit
6da949bbf0
1 changed files with 7 additions and 4 deletions
  1. 7
    4
      Marlin/Marlin_main.cpp

+ 7
- 4
Marlin/Marlin_main.cpp View File

@@ -10584,17 +10584,20 @@ void kill(const char* lcd_msg) {
10584 10584
   SERIAL_ERROR_START;
10585 10585
   SERIAL_ERRORLNPGM(MSG_ERR_KILLED);
10586 10586
 
10587
+  thermalManager.disable_all_heaters();
10588
+  disable_all_steppers();
10589
+            
10587 10590
   #if ENABLED(ULTRA_LCD)
10588 10591
     kill_screen(lcd_msg);
10589 10592
   #else
10590 10593
     UNUSED(lcd_msg);
10591 10594
   #endif
10592 10595
 
10593
-  delay(500); // Wait a short time
10594
-
10596
+  _delay_ms(250); // Wait a short time
10595 10597
   cli(); // Stop interrupts
10596
-  thermalManager.disable_all_heaters();
10597
-  disable_all_steppers();
10598
+            
10599
+  _delay_ms(250); //Wait to ensure all interrupts routines stopped
10600
+  thermalManager.disable_all_heaters(); //turn off heaters again
10598 10601
 
10599 10602
   #if HAS_POWER_SWITCH
10600 10603
     SET_INPUT(PS_ON_PIN);

Loading…
Cancel
Save