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,14 +2030,26 @@ static void clean_up_after_endstop_or_probe_move() {
2030 2030
         set_bltouch_deployed(true);        // Also needs to deploy and stow to
2031 2031
         set_bltouch_deployed(false);       // clear the triggered condition.
2032 2032
         if (TEST_BLTOUCH()) {              // If it still claims to be triggered...
2033
+          SERIAL_ERROR_START;
2034
+          SERIAL_ERRORLNPGM(MSG_STOP_BLTOUCH);
2033 2035
           stop();                          // punt!
2034 2036
           return true;
2035 2037
         }
2036 2038
       }
2037 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 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 2053
     #endif
2042 2054
 
2043 2055
     const float oldXpos = current_position[X_AXIS],
@@ -7385,7 +7397,7 @@ inline void gcode_M503() {
7385 7397
       if (nozzle_timed_out)
7386 7398
         lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_CLICK_TO_HEAT_NOZZLE);
7387 7399
 
7388
-      #if HAS_BUZZER 
7400
+      #if HAS_BUZZER
7389 7401
         filament_change_beep();
7390 7402
       #endif
7391 7403
 
@@ -7445,7 +7457,7 @@ inline void gcode_M503() {
7445 7457
     stepper.synchronize();
7446 7458
 
7447 7459
     #if defined(FILAMENT_CHANGE_EXTRUDE_LENGTH) && FILAMENT_CHANGE_EXTRUDE_LENGTH > 0
7448
-  
7460
+
7449 7461
       do {
7450 7462
         // "Wait for filament extrude"
7451 7463
         lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_EXTRUDE);
@@ -10298,7 +10310,11 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) {
10298 10310
 
10299 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 10319
   // Prevent steppers timing-out in the middle of M600
10304 10320
   #if ENABLED(FILAMENT_CHANGE_FEATURE) && ENABLED(FILAMENT_CHANGE_NO_STEPPER_TIMEOUT)
@@ -10306,7 +10322,7 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) {
10306 10322
   #else
10307 10323
     #define M600_TEST true
10308 10324
   #endif
10309
-             
10325
+
10310 10326
   if (M600_TEST && stepper_inactive_time && ELAPSED(ms, previous_cmd_ms + stepper_inactive_time)
10311 10327
       && !ignore_stepper_queue && !planner.blocks_queued()) {
10312 10328
     #if ENABLED(DISABLE_INACTIVE_X)
@@ -10348,7 +10364,11 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) {
10348 10364
     // Exceeded threshold and we can confirm that it was not accidental
10349 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 10372
   #endif
10353 10373
 
10354 10374
   #if HAS_HOME

+ 5
- 0
Marlin/language.h View File

@@ -200,6 +200,11 @@
200 200
 
201 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 208
 // temperature.cpp strings
204 209
 #define MSG_PID_AUTOTUNE                    "PID Autotune"
205 210
 #define MSG_PID_AUTOTUNE_START              MSG_PID_AUTOTUNE " start"

Loading…
Cancel
Save