Skip to content

Commit 820d2b5

Browse files
quiretthinkyhead
andauthored
🚸 Option to report temperature on error (#25341)
Co-authored-by: Scott Lahteine <[email protected]>
1 parent fe4819a commit 820d2b5

File tree

3 files changed

+100
-51
lines changed

3 files changed

+100
-51
lines changed

Marlin/src/core/language.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,8 @@
249249
#define STR_LASER_TEMP "laser temperature"
250250

251251
#define STR_STOPPED_HEATER ", system stopped! Heater_ID: "
252+
#define STR_DETECTED_TEMP_B " (temp: "
253+
#define STR_DETECTED_TEMP_E ")"
252254
#define STR_REDUNDANCY "Heater switched off. Temperature difference between temp sensors is too high !"
253255
#define STR_T_HEATING_FAILED "Heating failed"
254256
#define STR_T_THERMAL_RUNAWAY "Thermal Runaway"

Marlin/src/module/temperature.cpp

Lines changed: 89 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -839,10 +839,10 @@ volatile bool Temperature::raw_temps_ready = false;
839839
if (current_temp > watch_temp_target) heated = true; // - Flag if target temperature reached
840840
}
841841
else if (ELAPSED(ms, temp_change_ms)) // Watch timer expired
842-
_temp_error(heater_id, FPSTR(str_t_heating_failed), GET_TEXT_F(MSG_HEATING_FAILED_LCD));
842+
_TEMP_ERROR(heater_id, FPSTR(str_t_heating_failed), MSG_HEATING_FAILED_LCD, current_temp);
843843
}
844844
else if (current_temp < target - (MAX_OVERSHOOT_PID_AUTOTUNE)) // Heated, then temperature fell too far?
845-
_temp_error(heater_id, FPSTR(str_t_thermal_runaway), GET_TEXT_F(MSG_THERMAL_RUNAWAY));
845+
_TEMP_ERROR(heater_id, FPSTR(str_t_thermal_runaway), MSG_THERMAL_RUNAWAY, current_temp);
846846
}
847847
#endif
848848
} // every 2 seconds
@@ -1467,8 +1467,10 @@ inline void loud_kill(FSTR_P const lcd_msg, const heater_id_t heater_id) {
14671467
kill(lcd_msg, HEATER_FSTR(heater_id));
14681468
}
14691469

1470-
void Temperature::_temp_error(const heater_id_t heater_id, FSTR_P const serial_msg, FSTR_P const lcd_msg) {
1471-
1470+
void Temperature::_temp_error(
1471+
const heater_id_t heater_id, FSTR_P const serial_msg, FSTR_P const lcd_msg
1472+
OPTARG(ERR_INCLUDE_TEMP, const celsius_float_t deg)
1473+
) {
14721474
static uint8_t killed = 0;
14731475

14741476
if (IsRunning() && TERN1(BOGUS_TEMPERATURE_GRACE_PERIOD, killed == 2)) {
@@ -1493,10 +1495,13 @@ void Temperature::_temp_error(const heater_id_t heater_id, FSTR_P const serial_m
14931495
OPTCODE(HAS_TEMP_CHAMBER, case H_CHAMBER: SERIAL_ECHOPGM(STR_HEATER_CHAMBER); break)
14941496
OPTCODE(HAS_TEMP_BED, case H_BED: SERIAL_ECHOPGM(STR_HEATER_BED); break)
14951497
default:
1496-
if (real_heater_id >= 0)
1497-
SERIAL_ECHOLNPGM("E", real_heater_id);
1498+
if (real_heater_id >= 0) SERIAL_ECHO('E', real_heater_id);
14981499
}
1499-
SERIAL_EOL();
1500+
#if ENABLED(ERR_INCLUDE_TEMP)
1501+
SERIAL_ECHOLNPGM(STR_DETECTED_TEMP_B, deg, STR_DETECTED_TEMP_E);
1502+
#else
1503+
SERIAL_EOL();
1504+
#endif
15001505
}
15011506

15021507
disable_all_heaters(); // always disable (even for bogus temp)
@@ -1525,18 +1530,18 @@ void Temperature::_temp_error(const heater_id_t heater_id, FSTR_P const serial_m
15251530
#endif
15261531
}
15271532

1528-
void Temperature::maxtemp_error(const heater_id_t heater_id) {
1533+
void Temperature::maxtemp_error(const heater_id_t heater_id OPTARG(ERR_INCLUDE_TEMP, const celsius_float_t deg)) {
15291534
#if HAS_DWIN_E3V2_BASIC && (HAS_HOTEND || HAS_HEATED_BED)
15301535
dwinPopupTemperature(1);
15311536
#endif
1532-
_temp_error(heater_id, F(STR_T_MAXTEMP), GET_TEXT_F(MSG_ERR_MAXTEMP));
1537+
_TEMP_ERROR(heater_id, F(STR_T_MAXTEMP), MSG_ERR_MAXTEMP, deg);
15331538
}
15341539

1535-
void Temperature::mintemp_error(const heater_id_t heater_id) {
1540+
void Temperature::mintemp_error(const heater_id_t heater_id OPTARG(ERR_INCLUDE_TEMP, const celsius_float_t deg)) {
15361541
#if HAS_DWIN_E3V2_BASIC && (HAS_HOTEND || HAS_HEATED_BED)
15371542
dwinPopupTemperature(0);
15381543
#endif
1539-
_temp_error(heater_id, F(STR_T_MINTEMP), GET_TEXT_F(MSG_ERR_MINTEMP));
1544+
_TEMP_ERROR(heater_id, F(STR_T_MINTEMP), MSG_ERR_MINTEMP, deg);
15401545
}
15411546

15421547
#if HAS_PID_DEBUG
@@ -1736,7 +1741,10 @@ void Temperature::mintemp_error(const heater_id_t heater_id) {
17361741
void Temperature::manage_hotends(const millis_t &ms) {
17371742
HOTEND_LOOP() {
17381743
#if ENABLED(THERMAL_PROTECTION_HOTENDS)
1739-
if (degHotend(e) > temp_range[e].maxtemp) maxtemp_error((heater_id_t)e);
1744+
{
1745+
const auto deg = degHotend(e);
1746+
if (deg > temp_range[e].maxtemp) MAXTEMP_ERROR(e, deg);
1747+
}
17401748
#endif
17411749

17421750
TERN_(HEATER_IDLE_HANDLER, heater_idle[e].update(ms));
@@ -1746,16 +1754,18 @@ void Temperature::mintemp_error(const heater_id_t heater_id) {
17461754
tr_state_machine[e].run(temp_hotend[e].celsius, temp_hotend[e].target, (heater_id_t)e, THERMAL_PROTECTION_PERIOD, THERMAL_PROTECTION_HYSTERESIS);
17471755
#endif
17481756

1749-
temp_hotend[e].soft_pwm_amount = (temp_hotend[e].celsius > temp_range[e].mintemp || is_hotend_preheating(e)) && temp_hotend[e].celsius < temp_range[e].maxtemp ? (int)get_pid_output_hotend(e) >> 1 : 0;
1757+
temp_hotend[e].soft_pwm_amount = (temp_hotend[e].celsius > temp_range[e].mintemp || is_hotend_preheating(e))
1758+
&& temp_hotend[e].celsius < temp_range[e].maxtemp ? (int)get_pid_output_hotend(e) >> 1 : 0;
17501759

17511760
#if WATCH_HOTENDS
17521761
// Make sure temperature is increasing
17531762
if (watch_hotend[e].elapsed(ms)) { // Enabled and time to check?
1754-
if (watch_hotend[e].check(degHotend(e))) // Increased enough?
1763+
auto temp = degHotend(e);
1764+
if (watch_hotend[e].check(temp)) // Increased enough?
17551765
start_watching_hotend(e); // If temp reached, turn off elapsed check
17561766
else {
17571767
TERN_(HAS_DWIN_E3V2_BASIC, dwinPopupTemperature(0));
1758-
_temp_error((heater_id_t)e, FPSTR(str_t_heating_failed), GET_TEXT_F(MSG_HEATING_FAILED_LCD));
1768+
_TEMP_ERROR(e, FPSTR(str_t_heating_failed), MSG_HEATING_FAILED_LCD, temp);
17591769
}
17601770
}
17611771
#endif
@@ -1770,19 +1780,25 @@ void Temperature::mintemp_error(const heater_id_t heater_id) {
17701780
void Temperature::manage_heated_bed(const millis_t &ms) {
17711781

17721782
#if ENABLED(THERMAL_PROTECTION_BED)
1773-
if (degBed() > BED_MAXTEMP) maxtemp_error(H_BED);
1783+
{
1784+
const auto deg = degBed();
1785+
if (deg > BED_MAXTEMP) MAXTEMP_ERROR(H_BED, deg);
1786+
}
17741787
#endif
17751788

17761789
#if WATCH_BED
1790+
{
17771791
// Make sure temperature is increasing
17781792
if (watch_bed.elapsed(ms)) { // Time to check the bed?
1779-
if (watch_bed.check(degBed())) // Increased enough?
1793+
const auto deg = degBed();
1794+
if (watch_bed.check(deg)) // Increased enough?
17801795
start_watching_bed(); // If temp reached, turn off elapsed check
17811796
else {
17821797
TERN_(HAS_DWIN_E3V2_BASIC, dwinPopupTemperature(0));
1783-
_temp_error(H_BED, FPSTR(str_t_heating_failed), GET_TEXT_F(MSG_HEATING_FAILED_LCD));
1798+
_TEMP_ERROR(H_BED, FPSTR(str_t_heating_failed), MSG_HEATING_FAILED_LCD, deg);
17841799
}
17851800
}
1801+
}
17861802
#endif // WATCH_BED
17871803

17881804
#if ALL(PROBING_HEATERS_OFF, BED_LIMIT_SWITCHING)
@@ -1860,17 +1876,23 @@ void Temperature::mintemp_error(const heater_id_t heater_id) {
18601876
#endif
18611877

18621878
#if ENABLED(THERMAL_PROTECTION_CHAMBER)
1863-
if (degChamber() > (CHAMBER_MAXTEMP)) maxtemp_error(H_CHAMBER);
1879+
{
1880+
const auto deg = degChamber();
1881+
if (deg > CHAMBER_MAXTEMP) MAXTEMP_ERROR(H_CHAMBER, deg);
1882+
}
18641883
#endif
18651884

18661885
#if WATCH_CHAMBER
1886+
{
18671887
// Make sure temperature is increasing
18681888
if (watch_chamber.elapsed(ms)) { // Time to check the chamber?
1869-
if (watch_chamber.check(degChamber())) // Increased enough? Error below.
1889+
const auto deg = degChamber();
1890+
if (watch_chamber.check(deg)) // Increased enough? Error below.
18701891
start_watching_chamber(); // If temp reached, turn off elapsed check.
18711892
else
1872-
_temp_error(H_CHAMBER, FPSTR(str_t_heating_failed), GET_TEXT_F(MSG_HEATING_FAILED_LCD));
1893+
_TEMP_ERROR(H_CHAMBER, FPSTR(str_t_heating_failed), MSG_HEATING_FAILED_LCD, deg);
18731894
}
1895+
}
18741896
#endif
18751897

18761898
#if ANY(CHAMBER_FAN, CHAMBER_VENT) || DISABLED(PIDTEMPCHAMBER)
@@ -1986,16 +2008,20 @@ void Temperature::mintemp_error(const heater_id_t heater_id) {
19862008
#endif
19872009

19882010
#if ENABLED(THERMAL_PROTECTION_COOLER)
1989-
if (degCooler() > COOLER_MAXTEMP) maxtemp_error(H_COOLER);
2011+
{
2012+
const auto deg = degCooler();
2013+
if (deg > COOLER_MAXTEMP) MAXTEMP_ERROR(H_COOLER, deg);
2014+
}
19902015
#endif
19912016

19922017
#if WATCH_COOLER
19932018
// Make sure temperature is decreasing
19942019
if (watch_cooler.elapsed(ms)) { // Time to check the cooler?
1995-
if (degCooler() > watch_cooler.target) // Failed to decrease enough?
1996-
_temp_error(H_COOLER, GET_TEXT_F(MSG_COOLING_FAILED), GET_TEXT_F(MSG_COOLING_FAILED));
2020+
const auto deg = degCooler();
2021+
if (deg > watch_cooler.target) // Failed to decrease enough?
2022+
_TEMP_ERROR(H_COOLER, GET_TEXT_F(MSG_COOLING_FAILED), MSG_COOLING_FAILED, deg);
19972023
else
1998-
start_watching_cooler(); // Start again if the target is still far off
2024+
start_watching_cooler(); // Start again if the target is still far off
19992025
}
20002026
#endif
20012027

@@ -2076,20 +2102,32 @@ void Temperature::task() {
20762102

20772103
#if DISABLED(IGNORE_THERMOCOUPLE_ERRORS)
20782104
#if TEMP_SENSOR_IS_MAX_TC(0)
2079-
if (degHotend(0) > _MIN(HEATER_0_MAXTEMP, TEMP_SENSOR_0_MAX_TC_TMAX - 1.0)) maxtemp_error(H_E0);
2080-
if (degHotend(0) < _MAX(HEATER_0_MINTEMP, TEMP_SENSOR_0_MAX_TC_TMIN + .01)) mintemp_error(H_E0);
2105+
{
2106+
const auto deg = degHotend(0);
2107+
if (deg > _MIN(HEATER_0_MAXTEMP, TEMP_SENSOR_0_MAX_TC_TMAX - 1.0)) MAXTEMP_ERROR(H_E0, deg);
2108+
if (deg < _MAX(HEATER_0_MINTEMP, TEMP_SENSOR_0_MAX_TC_TMIN + .01)) MINTEMP_ERROR(H_E0, deg);
2109+
}
20812110
#endif
20822111
#if TEMP_SENSOR_IS_MAX_TC(1)
2083-
if (degHotend(1) > _MIN(HEATER_1_MAXTEMP, TEMP_SENSOR_1_MAX_TC_TMAX - 1.0)) maxtemp_error(H_E1);
2084-
if (degHotend(1) < _MAX(HEATER_1_MINTEMP, TEMP_SENSOR_1_MAX_TC_TMIN + .01)) mintemp_error(H_E1);
2112+
{
2113+
const auto deg = degHotend(1);
2114+
if (deg > _MIN(HEATER_1_MAXTEMP, TEMP_SENSOR_1_MAX_TC_TMAX - 1.0)) MAXTEMP_ERROR(H_E1, deg);
2115+
if (deg < _MAX(HEATER_1_MINTEMP, TEMP_SENSOR_1_MAX_TC_TMIN + .01)) MINTEMP_ERROR(H_E1, deg);
2116+
}
20852117
#endif
20862118
#if TEMP_SENSOR_IS_MAX_TC(2)
2087-
if (degHotend(2) > _MIN(HEATER_2_MAXTEMP, TEMP_SENSOR_2_MAX_TC_TMAX - 1.0)) maxtemp_error(H_E2);
2088-
if (degHotend(2) < _MAX(HEATER_2_MINTEMP, TEMP_SENSOR_2_MAX_TC_TMIN + .01)) mintemp_error(H_E2);
2119+
{
2120+
const auto deg = degHotend(2);
2121+
if (deg > _MIN(HEATER_2_MAXTEMP, TEMP_SENSOR_2_MAX_TC_TMAX - 1.0)) MAXTEMP_ERROR(H_E2, deg);
2122+
if (deg < _MAX(HEATER_2_MINTEMP, TEMP_SENSOR_2_MAX_TC_TMIN + .01)) MINTEMP_ERROR(H_E2, deg);
2123+
}
20892124
#endif
20902125
#if TEMP_SENSOR_IS_MAX_TC(REDUNDANT)
2091-
if (degRedundant() > TEMP_SENSOR_REDUNDANT_MAX_TC_TMAX - 1.0) maxtemp_error(H_REDUNDANT);
2092-
if (degRedundant() < TEMP_SENSOR_REDUNDANT_MAX_TC_TMIN + .01) mintemp_error(H_REDUNDANT);
2126+
{
2127+
const auto deg = degRedundant();
2128+
if (deg > TEMP_SENSOR_REDUNDANT_MAX_TC_TMAX - 1.0) MAXTEMP_ERROR(H_REDUNDANT, deg);
2129+
if (deg < TEMP_SENSOR_REDUNDANT_MAX_TC_TMIN + .01) MINTEMP_ERROR(H_REDUNDANT, deg);
2130+
}
20932131
#endif
20942132
#else
20952133
#warning "Safety Alert! Disable IGNORE_THERMOCOUPLE_ERRORS for the final build!"
@@ -2101,9 +2139,12 @@ void Temperature::task() {
21012139
TERN_(HAS_HOTEND, manage_hotends(ms));
21022140

21032141
#if HAS_TEMP_REDUNDANT
2142+
{
2143+
const auto deg = degRedundant();
21042144
// Make sure measured temperatures are close together
2105-
if (ABS(degRedundantTarget() - degRedundant()) > TEMP_SENSOR_REDUNDANT_MAX_DIFF)
2106-
_temp_error((heater_id_t)HEATER_ID(TEMP_SENSOR_REDUNDANT_TARGET), F(STR_REDUNDANCY), GET_TEXT_F(MSG_ERR_REDUNDANT_TEMP));
2145+
if (ABS(degRedundantTarget() - deg) > TEMP_SENSOR_REDUNDANT_MAX_DIFF)
2146+
_TEMP_ERROR(HEATER_ID(TEMP_SENSOR_REDUNDANT_TARGET), F(STR_REDUNDANCY), MSG_ERR_REDUNDANT_TEMP, deg);
2147+
}
21072148
#endif
21082149

21092150
// Manage extruder auto fans and/or read fan tachometers
@@ -2616,7 +2657,7 @@ void Temperature::updateTemperaturesFromRawValues() {
26162657
const raw_adc_t r = temp_hotend[e].getraw();
26172658
const bool neg = temp_dir[e] < 0, pos = temp_dir[e] > 0;
26182659
if ((neg && r < temp_range[e].raw_max) || (pos && r > temp_range[e].raw_max))
2619-
maxtemp_error((heater_id_t)e);
2660+
MAXTEMP_ERROR(e, temp_hotend[e].celsius);
26202661

26212662
/**
26222663
// DEBUG PREHEATING TIME
@@ -2628,7 +2669,7 @@ void Temperature::updateTemperaturesFromRawValues() {
26282669
const bool heater_on = temp_hotend[e].target > 0;
26292670
if (heater_on && !is_hotend_preheating(e) && ((neg && r > temp_range[e].raw_min) || (pos && r < temp_range[e].raw_min))) {
26302671
if (TERN1(MULTI_MAX_CONSECUTIVE_LOW_TEMP_ERR, ++consecutive_low_temperature_error[e] >= MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED))
2631-
mintemp_error((heater_id_t)e);
2672+
MINTEMP_ERROR(e, temp_hotend[e].celsius);
26322673
}
26332674
else {
26342675
TERN_(MULTI_MAX_CONSECUTIVE_LOW_TEMP_ERR, consecutive_low_temperature_error[e] = 0);
@@ -2639,27 +2680,27 @@ void Temperature::updateTemperaturesFromRawValues() {
26392680

26402681
#define TP_CMP(S,A,B) (TEMPDIR(S) < 0 ? ((A)<(B)) : ((A)>(B)))
26412682
#if ENABLED(THERMAL_PROTECTION_BED)
2642-
if (TP_CMP(BED, temp_bed.getraw(), maxtemp_raw_BED)) maxtemp_error(H_BED);
2643-
if (temp_bed.target > 0 && !is_bed_preheating() && TP_CMP(BED, mintemp_raw_BED, temp_bed.getraw())) mintemp_error(H_BED);
2683+
if (TP_CMP(BED, temp_bed.getraw(), maxtemp_raw_BED)) MAXTEMP_ERROR(H_BED, temp_bed.celsius);
2684+
if (temp_bed.target > 0 && !is_bed_preheating() && TP_CMP(BED, mintemp_raw_BED, temp_bed.getraw())) MINTEMP_ERROR(H_BED, temp_bed.celsius);
26442685
#endif
26452686

26462687
#if ALL(HAS_HEATED_CHAMBER, THERMAL_PROTECTION_CHAMBER)
2647-
if (TP_CMP(CHAMBER, temp_chamber.getraw(), maxtemp_raw_CHAMBER)) maxtemp_error(H_CHAMBER);
2648-
if (temp_chamber.target > 0 && TP_CMP(CHAMBER, mintemp_raw_CHAMBER, temp_chamber.getraw())) mintemp_error(H_CHAMBER);
2688+
if (TP_CMP(CHAMBER, temp_chamber.getraw(), maxtemp_raw_CHAMBER)) MAXTEMP_ERROR(H_CHAMBER, temp_chamber.celsius);
2689+
if (temp_chamber.target > 0 && TP_CMP(CHAMBER, mintemp_raw_CHAMBER, temp_chamber.getraw())) MINTEMP_ERROR(H_CHAMBER, temp_chamber.celsius);
26492690
#endif
26502691

26512692
#if ALL(HAS_COOLER, THERMAL_PROTECTION_COOLER)
2652-
if (cutter.unitPower > 0 && TP_CMP(COOLER, temp_cooler.getraw(), maxtemp_raw_COOLER)) maxtemp_error(H_COOLER);
2653-
if (TP_CMP(COOLER, mintemp_raw_COOLER, temp_cooler.getraw())) mintemp_error(H_COOLER);
2693+
if (cutter.unitPower > 0 && TP_CMP(COOLER, temp_cooler.getraw(), maxtemp_raw_COOLER)) MAXTEMP_ERROR(H_COOLER, temp_cooler.celsius);
2694+
if (TP_CMP(COOLER, mintemp_raw_COOLER, temp_cooler.getraw())) MINTEMP_ERROR(H_COOLER, temp_cooler.celsius);
26542695
#endif
26552696

26562697
#if ALL(HAS_TEMP_BOARD, THERMAL_PROTECTION_BOARD)
2657-
if (TP_CMP(BOARD, temp_board.getraw(), maxtemp_raw_BOARD)) maxtemp_error(H_BOARD);
2658-
if (TP_CMP(BOARD, mintemp_raw_BOARD, temp_board.getraw())) mintemp_error(H_BOARD);
2698+
if (TP_CMP(BOARD, temp_board.getraw(), maxtemp_raw_BOARD)) MAXTEMP_ERROR(H_BOARD, temp_board.celsius);
2699+
if (TP_CMP(BOARD, mintemp_raw_BOARD, temp_board.getraw())) MINTEMP_ERROR(H_BOARD, temp_board.celsius);
26592700
#endif
26602701

26612702
#if ALL(HAS_TEMP_SOC, THERMAL_PROTECTION_SOC)
2662-
if (TP_CMP(SOC, temp_soc.getraw(), maxtemp_raw_SOC)) maxtemp_error(H_SOC);
2703+
if (TP_CMP(SOC, temp_soc.getraw(), maxtemp_raw_SOC)) MAXTEMP_ERROR(H_SOC, temp_soc.celsius);
26632704
#endif
26642705
#undef TP_CMP
26652706

@@ -3178,12 +3219,12 @@ void Temperature::init() {
31783219

31793220
case TRRunaway:
31803221
TERN_(HAS_DWIN_E3V2_BASIC, dwinPopupTemperature(0));
3181-
_temp_error(heater_id, FPSTR(str_t_thermal_runaway), GET_TEXT_F(MSG_THERMAL_RUNAWAY));
3222+
_TEMP_ERROR(heater_id, FPSTR(str_t_thermal_runaway), MSG_THERMAL_RUNAWAY, current);
31823223

31833224
#if ENABLED(THERMAL_PROTECTION_VARIANCE_MONITOR)
31843225
case TRMalfunction:
31853226
TERN_(HAS_DWIN_E3V2_BASIC, dwinPopupTemperature(0));
3186-
_temp_error(heater_id, FPSTR(str_t_temp_malfunction), GET_TEXT_F(MSG_TEMP_MALFUNCTION));
3227+
_TEMP_ERROR(heater_id, FPSTR(str_t_temp_malfunction), MSG_TEMP_MALFUNCTION, current);
31873228
#endif
31883229
}
31893230
}

Marlin/src/module/temperature.h

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@
4141
#include "../feature/fancheck.h"
4242
#endif
4343

44+
//#define ERR_INCLUDE_TEMP
45+
4446
#define HOTEND_INDEX TERN(HAS_MULTI_HOTEND, e, 0)
4547
#define E_NAME TERN_(HAS_MULTI_HOTEND, e)
4648

@@ -1360,9 +1362,13 @@ class Temperature {
13601362
static float get_pid_output_chamber();
13611363
#endif
13621364

1363-
static void _temp_error(const heater_id_t e, FSTR_P const serial_msg, FSTR_P const lcd_msg);
1364-
static void mintemp_error(const heater_id_t e);
1365-
static void maxtemp_error(const heater_id_t e);
1365+
static void _temp_error(const heater_id_t e, FSTR_P const serial_msg, FSTR_P const lcd_msg OPTARG(ERR_INCLUDE_TEMP, const celsius_float_t deg));
1366+
static void mintemp_error(const heater_id_t e OPTARG(ERR_INCLUDE_TEMP, const celsius_float_t deg));
1367+
static void maxtemp_error(const heater_id_t e OPTARG(ERR_INCLUDE_TEMP, const celsius_float_t deg));
1368+
1369+
#define _TEMP_ERROR(e, m, l, d) _temp_error(heater_id_t(e), m, GET_TEXT_F(l) OPTARG(ERR_INCLUDE_TEMP, d))
1370+
#define MINTEMP_ERROR(e, d) mintemp_error(heater_id_t(e) OPTARG(ERR_INCLUDE_TEMP, d))
1371+
#define MAXTEMP_ERROR(e, d) maxtemp_error(heater_id_t(e) OPTARG(ERR_INCLUDE_TEMP, d))
13661372

13671373
#define HAS_THERMAL_PROTECTION ANY(THERMAL_PROTECTION_HOTENDS, THERMAL_PROTECTION_CHAMBER, THERMAL_PROTECTION_BED, THERMAL_PROTECTION_COOLER)
13681374

0 commit comments

Comments
 (0)