Browse Source

Message for every KILL and STOP

No more mystery halts & resets

Moved messages to language.h

Added current command to inactive timeout message
Bob-the-Kuhn 8 years ago
parent
commit
b31604a492
2 changed files with 32 additions and 7 deletions
  1. 27
    7
      Marlin/Marlin_main.cpp
  2. 5
    0
      Marlin/language.h

+ 27
- 7
Marlin/Marlin_main.cpp View File

2030
         set_bltouch_deployed(true);        // Also needs to deploy and stow to
2030
         set_bltouch_deployed(true);        // Also needs to deploy and stow to
2031
         set_bltouch_deployed(false);       // clear the triggered condition.
2031
         set_bltouch_deployed(false);       // clear the triggered condition.
2032
         if (TEST_BLTOUCH()) {              // If it still claims to be triggered...
2032
         if (TEST_BLTOUCH()) {              // If it still claims to be triggered...
2033
+          SERIAL_ERROR_START;
2034
+          SERIAL_ERRORLNPGM(MSG_STOP_BLTOUCH);
2033
           stop();                          // punt!
2035
           stop();                          // punt!
2034
           return true;
2036
           return true;
2035
         }
2037
         }
2036
       }
2038
       }
2037
     #elif ENABLED(Z_PROBE_SLED)
2039
     #elif ENABLED(Z_PROBE_SLED)
2038
-      if (axis_unhomed_error(true, false, false)) { stop(); return true; }
2040
+      if (axis_unhomed_error(true, false, false)) {
2041
+        SERIAL_ERROR_START;
2042
+        SERIAL_ERRORLNPGM(MSG_STOP_UNHOMED);
2043
+        stop();
2044
+        return true;
2045
+      }
2039
     #elif ENABLED(Z_PROBE_ALLEN_KEY)
2046
     #elif ENABLED(Z_PROBE_ALLEN_KEY)
2040
-      if (axis_unhomed_error(true, true,  true )) { stop(); return true; }
2047
+      if (axis_unhomed_error(true, true,  true )) {
2048
+        SERIAL_ERROR_START;
2049
+        SERIAL_ERRORLNPGM(MSG_STOP_UNHOMED);
2050
+        stop();
2051
+        return true;
2052
+      }
2041
     #endif
2053
     #endif
2042
 
2054
 
2043
     const float oldXpos = current_position[X_AXIS],
2055
     const float oldXpos = current_position[X_AXIS],
7385
       if (nozzle_timed_out)
7397
       if (nozzle_timed_out)
7386
         lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_CLICK_TO_HEAT_NOZZLE);
7398
         lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_CLICK_TO_HEAT_NOZZLE);
7387
 
7399
 
7388
-      #if HAS_BUZZER 
7400
+      #if HAS_BUZZER
7389
         filament_change_beep();
7401
         filament_change_beep();
7390
       #endif
7402
       #endif
7391
 
7403
 
7445
     stepper.synchronize();
7457
     stepper.synchronize();
7446
 
7458
 
7447
     #if defined(FILAMENT_CHANGE_EXTRUDE_LENGTH) && FILAMENT_CHANGE_EXTRUDE_LENGTH > 0
7459
     #if defined(FILAMENT_CHANGE_EXTRUDE_LENGTH) && FILAMENT_CHANGE_EXTRUDE_LENGTH > 0
7448
-  
7460
+
7449
       do {
7461
       do {
7450
         // "Wait for filament extrude"
7462
         // "Wait for filament extrude"
7451
         lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_EXTRUDE);
7463
         lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_EXTRUDE);
10298
 
10310
 
10299
   millis_t ms = millis();
10311
   millis_t ms = millis();
10300
 
10312
 
10301
-  if (max_inactive_time && ELAPSED(ms, previous_cmd_ms + max_inactive_time)) kill(PSTR(MSG_KILLED));
10313
+  if (max_inactive_time && ELAPSED(ms, previous_cmd_ms + max_inactive_time)) {
10314
+    SERIAL_ERROR_START;
10315
+    SERIAL_ECHOLNPAIR(MSG_KILL_INACTIVE_TIME, current_command);
10316
+    kill(PSTR(MSG_KILLED));
10317
+  }
10302
 
10318
 
10303
   // Prevent steppers timing-out in the middle of M600
10319
   // Prevent steppers timing-out in the middle of M600
10304
   #if ENABLED(FILAMENT_CHANGE_FEATURE) && ENABLED(FILAMENT_CHANGE_NO_STEPPER_TIMEOUT)
10320
   #if ENABLED(FILAMENT_CHANGE_FEATURE) && ENABLED(FILAMENT_CHANGE_NO_STEPPER_TIMEOUT)
10306
   #else
10322
   #else
10307
     #define M600_TEST true
10323
     #define M600_TEST true
10308
   #endif
10324
   #endif
10309
-             
10325
+
10310
   if (M600_TEST && stepper_inactive_time && ELAPSED(ms, previous_cmd_ms + stepper_inactive_time)
10326
   if (M600_TEST && stepper_inactive_time && ELAPSED(ms, previous_cmd_ms + stepper_inactive_time)
10311
       && !ignore_stepper_queue && !planner.blocks_queued()) {
10327
       && !ignore_stepper_queue && !planner.blocks_queued()) {
10312
     #if ENABLED(DISABLE_INACTIVE_X)
10328
     #if ENABLED(DISABLE_INACTIVE_X)
10348
     // Exceeded threshold and we can confirm that it was not accidental
10364
     // Exceeded threshold and we can confirm that it was not accidental
10349
     // KILL the machine
10365
     // KILL the machine
10350
     // ----------------------------------------------------------------
10366
     // ----------------------------------------------------------------
10351
-    if (killCount >= KILL_DELAY) kill(PSTR(MSG_KILLED));
10367
+    if (killCount >= KILL_DELAY) {
10368
+      SERIAL_ERROR_START;
10369
+      SERIAL_ERRORLNPGM(MSG_KILL_BUTTON);
10370
+      kill(PSTR(MSG_KILLED));
10371
+    }
10352
   #endif
10372
   #endif
10353
 
10373
 
10354
   #if HAS_HOME
10374
   #if HAS_HOME

+ 5
- 0
Marlin/language.h View File

200
 
200
 
201
 #define MSG_ERR_EEPROM_WRITE                "Error writing to EEPROM!"
201
 #define MSG_ERR_EEPROM_WRITE                "Error writing to EEPROM!"
202
 
202
 
203
+#define MSG_STOP_BLTOUCH                    "STOP called because of BLTouch error - restart with M999"
204
+#define MSG_STOP_UNHOMED                    "STOP called because of unhomed error - restart with M999"
205
+#define MSG_KILL_INACTIVE_TIME              "KILL caused by too much inactive time - current command: "
206
+#define MSG_KILL_BUTTON                     "KILL caused by KILL button/pin"
207
+
203
 // temperature.cpp strings
208
 // temperature.cpp strings
204
 #define MSG_PID_AUTOTUNE                    "PID Autotune"
209
 #define MSG_PID_AUTOTUNE                    "PID Autotune"
205
 #define MSG_PID_AUTOTUNE_START              MSG_PID_AUTOTUNE " start"
210
 #define MSG_PID_AUTOTUNE_START              MSG_PID_AUTOTUNE " start"

Loading…
Cancel
Save