|
@@ -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) {
|
|
@@ -675,9 +683,8 @@ void Temperature::manage_heater() {
|
675
|
683
|
updateTemperaturesFromRawValues(); // also resets the watchdog
|
676
|
684
|
|
677
|
685
|
#if ENABLED(HEATER_0_USES_MAX6675)
|
678
|
|
- float ct = current_temperature[0];
|
679
|
|
- if (ct > min(HEATER_0_MAXTEMP, 1023)) max_temp_error(0);
|
680
|
|
- if (ct < max(HEATER_0_MINTEMP, 0.01)) min_temp_error(0);
|
|
686
|
+ if (current_temperature[0] > min(HEATER_0_MAXTEMP, 1023)) max_temp_error(0);
|
|
687
|
+ if (current_temperature[0] < max(HEATER_0_MINTEMP, 0.01)) min_temp_error(0);
|
681
|
688
|
#endif
|
682
|
689
|
|
683
|
690
|
#if (ENABLED(THERMAL_PROTECTION_HOTENDS) && WATCH_TEMP_PERIOD > 0) || (ENABLED(THERMAL_PROTECTION_BED) && WATCH_BED_TEMP_PERIOD > 0) || DISABLED(PIDTEMPBED) || HAS_AUTO_FAN
|
|
@@ -1815,8 +1822,8 @@ void Temperature::isr() {
|
1815
|
1822
|
#else
|
1816
|
1823
|
#define GEBED >=
|
1817
|
1824
|
#endif
|
1818
|
|
- if (current_temperature_bed_raw GEBED bed_maxttemp_raw) _temp_error(-1, PSTR(MSG_T_MAXTEMP), PSTR(MSG_ERR_MAXTEMP_BED));
|
1819
|
|
- if (bed_minttemp_raw GEBED current_temperature_bed_raw) _temp_error(-1, PSTR(MSG_T_MINTEMP), PSTR(MSG_ERR_MINTEMP_BED));
|
|
1825
|
+ if (current_temperature_bed_raw GEBED bed_maxttemp_raw) max_temp_error(-1);
|
|
1826
|
+ if (bed_minttemp_raw GEBED current_temperature_bed_raw && target_temperature_bed > 0.0f) min_temp_error(-1);
|
1820
|
1827
|
#endif
|
1821
|
1828
|
|
1822
|
1829
|
} // temp_count >= OVERSAMPLENR
|