Browse Source

Extend min/max_temp_error for the bed

Scott Lahteine 7 years ago
parent
commit
3e8f9ecd1c
2 changed files with 18 additions and 10 deletions
  1. 16
    8
      Marlin/temperature.cpp
  2. 2
    2
      Marlin/temperature.h

+ 16
- 8
Marlin/temperature.cpp View File

@@ -517,17 +517,25 @@ void Temperature::_temp_error(int e, const char* serial_msg, const char* lcd_msg
517 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 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 538
   #endif
530
-  _temp_error(HOTEND_INDEX, PSTR(MSG_T_MINTEMP), PSTR(MSG_ERR_MINTEMP));
531 539
 }
532 540
 
533 541
 float Temperature::get_pid_output(int e) {

+ 2
- 2
Marlin/temperature.h View File

@@ -437,8 +437,8 @@ class Temperature {
437 437
     #endif
438 438
 
439 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 443
     #if ENABLED(THERMAL_PROTECTION_HOTENDS) || HAS_THERMALLY_PROTECTED_BED
444 444
 

Loading…
Cancel
Save