Selaa lähdekoodia

Extend min/max_temp_error for the bed

Scott Lahteine 8 vuotta sitten
vanhempi
commit
3e8f9ecd1c
2 muutettua tiedostoa jossa 18 lisäystä ja 10 poistoa
  1. 16
    8
      Marlin/temperature.cpp
  2. 2
    2
      Marlin/temperature.h

+ 16
- 8
Marlin/temperature.cpp Näytä tiedosto

517
   #endif
517
   #endif
518
 }
518
 }
519
 
519
 
520
-void Temperature::max_temp_error(uint8_t e) {
521
-  #if HOTENDS == 1
522
-    UNUSED(e);
520
+void Temperature::max_temp_error(int8_t e) {
521
+  #if HAS_TEMP_BED
522
+    _temp_error(e, PSTR(MSG_T_MAXTEMP), e >= 0 ? PSTR(MSG_ERR_MAXTEMP) : PSTR(MSG_ERR_MAXTEMP_BED));
523
+  #else
524
+    _temp_error(HOTEND_INDEX, PSTR(MSG_T_MAXTEMP), PSTR(MSG_ERR_MAXTEMP));
525
+    #if HOTENDS == 1
526
+      UNUSED(e);
527
+    #endif
523
   #endif
528
   #endif
524
-  _temp_error(HOTEND_INDEX, PSTR(MSG_T_MAXTEMP), PSTR(MSG_ERR_MAXTEMP));
525
 }
529
 }
526
-void Temperature::min_temp_error(uint8_t e) {
527
-  #if HOTENDS == 1
528
-    UNUSED(e);
530
+void Temperature::min_temp_error(int8_t e) {
531
+  #if HAS_TEMP_BED
532
+    _temp_error(e, PSTR(MSG_T_MINTEMP), e >= 0 ? PSTR(MSG_ERR_MINTEMP) : PSTR(MSG_ERR_MINTEMP_BED));
533
+  #else
534
+    _temp_error(HOTEND_INDEX, PSTR(MSG_T_MINTEMP), PSTR(MSG_ERR_MINTEMP));
535
+    #if HOTENDS == 1
536
+      UNUSED(e);
537
+    #endif
529
   #endif
538
   #endif
530
-  _temp_error(HOTEND_INDEX, PSTR(MSG_T_MINTEMP), PSTR(MSG_ERR_MINTEMP));
531
 }
539
 }
532
 
540
 
533
 float Temperature::get_pid_output(int e) {
541
 float Temperature::get_pid_output(int e) {

+ 2
- 2
Marlin/temperature.h Näytä tiedosto

437
     #endif
437
     #endif
438
 
438
 
439
     static void _temp_error(int e, const char* serial_msg, const char* lcd_msg);
439
     static void _temp_error(int e, const char* serial_msg, const char* lcd_msg);
440
-    static void min_temp_error(uint8_t e);
441
-    static void max_temp_error(uint8_t e);
440
+    static void min_temp_error(int8_t e);
441
+    static void max_temp_error(int8_t e);
442
 
442
 
443
     #if ENABLED(THERMAL_PROTECTION_HOTENDS) || HAS_THERMALLY_PROTECTED_BED
443
     #if ENABLED(THERMAL_PROTECTION_HOTENDS) || HAS_THERMALLY_PROTECTED_BED
444
 
444
 

Loading…
Peruuta
Tallenna