Переглянути джерело

Use _temp_error() for all errors thrown by different mechanisms

Now ending in an endless loop.
Tidy up the output format.
We now get:
ERRORTEXT ", system stopped! Heater_ID: " HEATERID

Where ERRORTEXT can be:
"Heating failed"
"Thermal Runaway"
"MAXTEMP triggered"
"MINTEMP triggered"
and soon
"Thermal Jump"

HEATERID can be
0, 1, 2 ,3 , "bed"

This messages are always followed by the common:
"Printer stopped due to errors. Fix the error and use M999 to restart. (Temperature is reset. Set it after restarting)"
AnHardt 10 роки тому
джерело
коміт
70163dafb9
2 змінених файлів з 18 додано та 25 видалено
  1. 9
    8
      Marlin/language.h
  2. 9
    17
      Marlin/temperature.cpp

+ 9
- 8
Marlin/language.h Переглянути файл

@@ -222,15 +222,16 @@
222 222
 #define MSG_PID_DEBUG_PTERM                 " pTerm "
223 223
 #define MSG_PID_DEBUG_ITERM                 " iTerm "
224 224
 #define MSG_PID_DEBUG_DTERM                 " dTerm "
225
-#define MSG_HEATING_FAILED                  "Heating failed"
226
-#define MSG_EXTRUDER_SWITCHED_OFF           "Extruder switched off. Temperature difference between temp sensors is too high !"
227
-
228 225
 #define MSG_INVALID_EXTRUDER_NUM            " - Invalid extruder number !"
229
-#define MSG_THERMAL_RUNAWAY_STOP            "Thermal Runaway, system stopped! Heater_ID: "
230
-#define MSG_SWITCHED_OFF_MAX                " switched off. MAXTEMP triggered !!"
231
-#define MSG_MINTEMP_EXTRUDER_OFF            ": Extruder switched off. MINTEMP triggered !"
232
-#define MSG_MAXTEMP_EXTRUDER_OFF            ": Extruder" MSG_SWITCHED_OFF_MAX
233
-#define MSG_MAXTEMP_BED_OFF                 "Heated bed" MSG_SWITCHED_OFF_MAX
226
+
227
+#define MSG_HEATER_BED                      "bed"
228
+#define MSG_STOPPED_HEATER                  ", system stopped! Heater_ID: "
229
+#define MSG_REDUNDANCY                      "Heater switched off. Temperature difference between temp sensors is too high !"
230
+#define MSG_T_HEATING_FAILED                "Heating failed"
231
+#define MSG_T_THERMAL_RUNAWAY               "Thermal Runaway"
232
+#define MSG_T_MAXTEMP                       "MAXTEMP triggered"
233
+#define MSG_T_MINTEMP                       "MINTEMP triggered"
234
+
234 235
 
235 236
 // LCD Menu Messages
236 237
 

+ 9
- 17
Marlin/temperature.cpp Переглянути файл

@@ -449,31 +449,33 @@ void checkExtruderAutoFans()
449 449
 inline void _temp_error(int e, const char *serial_msg, const char *lcd_msg) {
450 450
   if (IsRunning()) {
451 451
     SERIAL_ERROR_START;
452
-    if (e >= 0) SERIAL_ERRORLN((int)e);
453 452
     serialprintPGM(serial_msg);
454
-    MYSERIAL.write('\n');
453
+    SERIAL_ERRORPGM(MSG_STOPPED_HEATER);
454
+    if (e >= 0) SERIAL_ERRORLN((int)e); else SERIAL_ERRORLNPGM(MSG_HEATER_BED);
455 455
     #ifdef ULTRA_LCD
456 456
       lcd_setalertstatuspgm(lcd_msg);
457 457
     #endif
458 458
   }
459 459
   #ifndef BOGUS_TEMPERATURE_FAILSAFE_OVERRIDE
460
+    disable_all_steppers();
460 461
     Stop();
462
+    while (true) lcd_update();
461 463
   #endif
462 464
 }
463 465
 
464 466
 void max_temp_error(uint8_t e) {
465 467
   disable_all_heaters();
466
-  _temp_error(e, PSTR(MSG_MAXTEMP_EXTRUDER_OFF), PSTR(MSG_ERR_MAXTEMP));
468
+  _temp_error(e, PSTR(MSG_T_MAXTEMP), PSTR(MSG_ERR_MAXTEMP));
467 469
 }
468 470
 void min_temp_error(uint8_t e) {
469 471
   disable_all_heaters();
470
-  _temp_error(e, PSTR(MSG_MINTEMP_EXTRUDER_OFF), PSTR(MSG_ERR_MINTEMP));
472
+  _temp_error(e, PSTR(MSG_T_MINTEMP), PSTR(MSG_ERR_MINTEMP));
471 473
 }
472 474
 void bed_max_temp_error(void) {
473 475
   #if HAS_HEATER_BED
474 476
     WRITE_HEATER_BED(0);
475 477
   #endif
476
-  _temp_error(-1, PSTR(MSG_MAXTEMP_BED_OFF), PSTR(MSG_ERR_MAXTEMP_BED));
478
+  _temp_error(-1, PSTR(MSG_T_MAXTEMP), PSTR(MSG_ERR_MAXTEMP_BED));
477 479
 }
478 480
 
479 481
 float get_pid_output(int e) {
@@ -627,8 +629,7 @@ void manage_heater() {
627 629
         // Has it failed to increase enough?
628 630
         if (degHotend(e) < watch_target_temp[e]) {
629 631
           // Stop!
630
-          disable_all_heaters();
631
-          _temp_error(e, PSTR(MSG_HEATING_FAILED), PSTR(MSG_HEATING_FAILED_LCD));
632
+          _temp_error(e, PSTR(MSG_T_HEATING_FAILED), PSTR(MSG_HEATING_FAILED_LCD));
632 633
         }
633 634
         else {
634 635
           // Start again if the target is still far off
@@ -1070,16 +1071,7 @@ void tp_init() {
1070 1071
           *state = TRRunaway;
1071 1072
         break;
1072 1073
       case TRRunaway:
1073
-        SERIAL_ERROR_START;
1074
-        SERIAL_ERRORLNPGM(MSG_THERMAL_RUNAWAY_STOP);
1075
-        if (heater_id < 0) SERIAL_ERRORLNPGM("bed"); else SERIAL_ERRORLN(heater_id);
1076
-        LCD_ALERTMESSAGEPGM(MSG_THERMAL_RUNAWAY);
1077
-        disable_all_heaters();
1078
-        disable_all_steppers();
1079
-        for (;;) {
1080
-          manage_heater();
1081
-          lcd_update();
1082
-        }
1074
+        _temp_error(heater_id, PSTR(MSG_T_THERMAL_RUNAWAY), PSTR(MSG_THERMAL_RUNAWAY));
1083 1075
     }
1084 1076
   }
1085 1077
 

Завантаження…
Відмінити
Зберегти