Browse Source

add delays to allow stop & kill messages to get out

Bob-the-Kuhn 8 years ago
parent
commit
185337e787
1 changed files with 3 additions and 2 deletions
  1. 3
    2
      Marlin/Marlin_main.cpp

+ 3
- 2
Marlin/Marlin_main.cpp View File

@@ -11053,7 +11053,7 @@ void kill(const char* lcd_msg) {
11053 11053
     UNUSED(lcd_msg);
11054 11054
   #endif
11055 11055
 
11056
-  _delay_ms(250); // Wait a short time
11056
+  _delay_ms(600); // Wait a short time (allows messages to get out before shutting down.
11057 11057
   cli(); // Stop interrupts
11058 11058
 
11059 11059
   _delay_ms(250); //Wait to ensure all interrupts routines stopped
@@ -11078,11 +11078,12 @@ void kill(const char* lcd_msg) {
11078 11078
 void stop() {
11079 11079
   thermalManager.disable_all_heaters();
11080 11080
   if (IsRunning()) {
11081
-    Running = false;
11082 11081
     Stopped_gcode_LastN = gcode_LastN; // Save last g_code for restart
11083 11082
     SERIAL_ERROR_START;
11084 11083
     SERIAL_ERRORLNPGM(MSG_ERR_STOPPED);
11085 11084
     LCD_MESSAGEPGM(MSG_STOPPED);
11085
+    safe_delay(350);       // allow enough time for messages to get out before stopping
11086
+    Running = false;
11086 11087
   }
11087 11088
 }
11088 11089
 

Loading…
Cancel
Save