Selaa lähdekoodia

Add extra max-temp safety checks (#13756)

Marcio Teixeira 6 vuotta sitten
vanhempi
commit
d0c1eee53b
2 muutettua tiedostoa jossa 18 lisäystä ja 7 poistoa
  1. 6
    0
      Marlin/src/lcd/language/language_en.h
  2. 12
    7
      Marlin/src/module/temperature.cpp

+ 6
- 0
Marlin/src/lcd/language/language_en.h Näytä tiedosto

930
 #ifndef MSG_HEATING_FAILED_LCD_BED
930
 #ifndef MSG_HEATING_FAILED_LCD_BED
931
   #define MSG_HEATING_FAILED_LCD_BED          _UxGT("Bed heating failed")
931
   #define MSG_HEATING_FAILED_LCD_BED          _UxGT("Bed heating failed")
932
 #endif
932
 #endif
933
+#ifndef MSG_HEATING_FAILED_LCD_CHAMBER
934
+  #define MSG_HEATING_FAILED_LCD_CHAMBER      _UxGT("Chamber heating fail")
935
+#endif
933
 #ifndef MSG_ERR_REDUNDANT_TEMP
936
 #ifndef MSG_ERR_REDUNDANT_TEMP
934
   #define MSG_ERR_REDUNDANT_TEMP              _UxGT("Err: REDUNDANT TEMP")
937
   #define MSG_ERR_REDUNDANT_TEMP              _UxGT("Err: REDUNDANT TEMP")
935
 #endif
938
 #endif
939
 #ifndef MSG_THERMAL_RUNAWAY_BED
942
 #ifndef MSG_THERMAL_RUNAWAY_BED
940
   #define MSG_THERMAL_RUNAWAY_BED             _UxGT("BED THERMAL RUNAWAY")
943
   #define MSG_THERMAL_RUNAWAY_BED             _UxGT("BED THERMAL RUNAWAY")
941
 #endif
944
 #endif
945
+#ifndef MSG_THERMAL_RUNAWAY_CHAMBER
946
+  #define MSG_THERMAL_RUNAWAY_CHAMBER         _UxGT("CHAMBER T. RUNAWAY")
947
+#endif
942
 #ifndef MSG_ERR_MAXTEMP
948
 #ifndef MSG_ERR_MAXTEMP
943
   #define MSG_ERR_MAXTEMP                     _UxGT("Err: MAXTEMP")
949
   #define MSG_ERR_MAXTEMP                     _UxGT("Err: MAXTEMP")
944
 #endif
950
 #endif

+ 12
- 7
Marlin/src/module/temperature.cpp Näytä tiedosto

86
  */
86
  */
87
 
87
 
88
 #if HAS_HEATED_BED
88
 #if HAS_HEATED_BED
89
-  #define _BED_PSTR(E) (E) == -1 ? PSTR(MSG ## _BED) :
89
+  #define _BED_PSTR(M,E) (E) == -1 ? PSTR(M ## _BED) :
90
 #else
90
 #else
91
-  #define _BED_PSTR(E)
91
+  #define _BED_PSTR(M,E)
92
 #endif
92
 #endif
93
 #if HAS_HEATED_CHAMBER
93
 #if HAS_HEATED_CHAMBER
94
-  #define _CHAMBER_PSTR(E) (E) == -2 ? PSTR(MSG ## _CHAMBER) :
94
+  #define _CHAMBER_PSTR(M,E) (E) == -2 ? PSTR(M ## _CHAMBER) :
95
 #else
95
 #else
96
-  #define _CHAMBER_PSTR(E)
96
+  #define _CHAMBER_PSTR(M,E)
97
 #endif
97
 #endif
98
-#define _E_PSTR(M,E,N) (HOTENDS >= (N) && (E) == (N)-1) ? PSTR(MSG_E##N " " M) :
99
-#define TEMP_ERR_PSTR(M,E) _BED_PSTR(E) _CHAMBER_PSTR(E) _E_PSTR(M,E,2) _E_PSTR(M,E,3) _E_PSTR(M,E,4) _E_PSTR(M,E,5) _E_PSTR(M,E,6) PSTR(MSG_E1 " " M)
98
+#define _E_PSTR(M,E,N) ((HOTENDS) >= (N) && (E) == (N)-1) ? PSTR(MSG_E##N " " M) :
99
+#define TEMP_ERR_PSTR(M,E) _BED_PSTR(M,E) _CHAMBER_PSTR(M,E) _E_PSTR(M,E,2) _E_PSTR(M,E,3) _E_PSTR(M,E,4) _E_PSTR(M,E,5) _E_PSTR(M,E,6) PSTR(MSG_E1 " " M)
100
 
100
 
101
 // public:
101
 // public:
102
 
102
 
949
   #endif
949
   #endif
950
 
950
 
951
   HOTEND_LOOP() {
951
   HOTEND_LOOP() {
952
+    if (degHotend(e) > temp_range[e].maxtemp)
953
+      temp_error(e, PSTR(MSG_T_THERMAL_RUNAWAY), TEMP_ERR_PSTR(MSG_THERMAL_RUNAWAY, e));
952
 
954
 
953
     #if HEATER_IDLE_HANDLER
955
     #if HEATER_IDLE_HANDLER
954
       hotend_idle[e].update(ms);
956
       hotend_idle[e].update(ms);
1001
 
1003
 
1002
   #if HAS_HEATED_BED
1004
   #if HAS_HEATED_BED
1003
 
1005
 
1006
+    if (degBed() > BED_MAXTEMP)
1007
+      temp_error(-1, PSTR(MSG_T_THERMAL_RUNAWAY), TEMP_ERR_PSTR(MSG_THERMAL_RUNAWAY, -1));
1008
+
1004
     #if WATCH_BED
1009
     #if WATCH_BED
1005
       // Make sure temperature is increasing
1010
       // Make sure temperature is increasing
1006
       if (watch_bed.elapsed(ms)) {        // Time to check the bed?
1011
       if (watch_bed.elapsed(ms)) {        // Time to check the bed?
2647
     void Temperature::set_heating_message(const uint8_t e) {
2652
     void Temperature::set_heating_message(const uint8_t e) {
2648
       const bool heating = isHeatingHotend(e);
2653
       const bool heating = isHeatingHotend(e);
2649
       #if HOTENDS > 1
2654
       #if HOTENDS > 1
2650
-        ui.status_printf_P(0, heating ? PSTR("E%i " MSG_HEATING) : PSTR("E%i " MSG_COOLING), int(e + 1));
2655
+        ui.status_printf_P(0, heating ? PSTR("E%c " MSG_HEATING) : PSTR("E%c " MSG_COOLING), '1' + e);
2651
       #else
2656
       #else
2652
         ui.set_status_P(heating ? PSTR("E " MSG_HEATING) : PSTR("E " MSG_COOLING));
2657
         ui.set_status_P(heating ? PSTR("E " MSG_HEATING) : PSTR("E " MSG_COOLING));
2653
       #endif
2658
       #endif

Loading…
Peruuta
Tallenna