Просмотр исходного кода

Merge pull request #6027 from Bob-the-Kuhn/add_kill_info

Message for every KILL and STOP
Scott Lahteine 8 лет назад
Родитель
Сommit
0492a3a8f1
2 измененных файлов: 29 добавлений и 4 удалений
  1. 24
    4
      Marlin/Marlin_main.cpp
  2. 5
    0
      Marlin/language.h

+ 24
- 4
Marlin/Marlin_main.cpp Просмотреть файл

@@ -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],
@@ -10153,7 +10165,11 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) {
10153 10165
 
10154 10166
   millis_t ms = millis();
10155 10167
 
10156
-  if (max_inactive_time && ELAPSED(ms, previous_cmd_ms + max_inactive_time)) kill(PSTR(MSG_KILLED));
10168
+  if (max_inactive_time && ELAPSED(ms, previous_cmd_ms + max_inactive_time)) {
10169
+    SERIAL_ERROR_START;
10170
+    SERIAL_ECHOLNPAIR(MSG_KILL_INACTIVE_TIME, current_command);
10171
+    kill(PSTR(MSG_KILLED));
10172
+  }
10157 10173
 
10158 10174
   // Prevent steppers timing-out in the middle of M600
10159 10175
   #if ENABLED(FILAMENT_CHANGE_FEATURE) && ENABLED(FILAMENT_CHANGE_NO_STEPPER_TIMEOUT)
@@ -10203,7 +10219,11 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) {
10203 10219
     // Exceeded threshold and we can confirm that it was not accidental
10204 10220
     // KILL the machine
10205 10221
     // ----------------------------------------------------------------
10206
-    if (killCount >= KILL_DELAY) kill(PSTR(MSG_KILLED));
10222
+    if (killCount >= KILL_DELAY) {
10223
+      SERIAL_ERROR_START;
10224
+      SERIAL_ERRORLNPGM(MSG_KILL_BUTTON);
10225
+      kill(PSTR(MSG_KILLED));
10226
+    }
10207 10227
   #endif
10208 10228
 
10209 10229
   #if HAS_HOME

+ 5
- 0
Marlin/language.h Просмотреть файл

@@ -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"

Загрузка…
Отмена
Сохранить