Skip to content

Commit 58e9dc0

Browse files
committed
🎨 Rename *_temp_error to *temp_error
1 parent 5e69a3d commit 58e9dc0

3 files changed

Lines changed: 30 additions & 30 deletions

File tree

Marlin/Configuration_adv.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -469,18 +469,18 @@
469469
* Thermistors able to support high temperature tend to have a hard time getting
470470
* good readings at room and lower temperatures. This means TEMP_SENSOR_X_RAW_LO_TEMP
471471
* will probably be caught when the heating element first turns on during the
472-
* preheating process, which will trigger a min_temp_error as a safety measure
472+
* preheating process, which will trigger a MINTEMP error as a safety measure
473473
* and force stop everything.
474474
* To circumvent this limitation, we allow for a preheat time (during which,
475-
* min_temp_error won't be triggered) and add a min_temp buffer to handle
475+
* MINTEMP error won't be triggered) and add a min_temp buffer to handle
476476
* aberrant readings.
477477
*
478478
* If you want to enable this feature for your hotend thermistor(s)
479479
* uncomment and set values > 0 in the constants below
480480
*/
481481

482482
// The number of consecutive low temperature errors that can occur
483-
// before a min_temp_error is triggered. (Shouldn't be more than 10.)
483+
// before a MINTEMP error is triggered. (Shouldn't be more than 10.)
484484
//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0
485485

486486
/**

Marlin/src/module/temperature.cpp

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1318,14 +1318,14 @@ void Temperature::_temp_error(const heater_id_t heater_id, FSTR_P const serial_m
13181318
#endif
13191319
}
13201320

1321-
void Temperature::max_temp_error(const heater_id_t heater_id) {
1321+
void Temperature::maxtemp_error(const heater_id_t heater_id) {
13221322
#if HAS_DWIN_E3V2_BASIC && (HAS_HOTEND || HAS_HEATED_BED)
13231323
DWIN_Popup_Temperature(1);
13241324
#endif
13251325
_temp_error(heater_id, F(STR_T_MAXTEMP), GET_TEXT_F(MSG_ERR_MAXTEMP));
13261326
}
13271327

1328-
void Temperature::min_temp_error(const heater_id_t heater_id) {
1328+
void Temperature::mintemp_error(const heater_id_t heater_id) {
13291329
#if HAS_DWIN_E3V2_BASIC && (HAS_HOTEND || HAS_HEATED_BED)
13301330
DWIN_Popup_Temperature(0);
13311331
#endif
@@ -1545,7 +1545,7 @@ void Temperature::min_temp_error(const heater_id_t heater_id) {
15451545
void Temperature::manage_hotends(const millis_t &ms) {
15461546
HOTEND_LOOP() {
15471547
#if ENABLED(THERMAL_PROTECTION_HOTENDS)
1548-
if (degHotend(e) > temp_range[e].maxtemp) max_temp_error((heater_id_t)e);
1548+
if (degHotend(e) > temp_range[e].maxtemp) maxtemp_error((heater_id_t)e);
15491549
#endif
15501550

15511551
TERN_(HEATER_IDLE_HANDLER, heater_idle[e].update(ms));
@@ -1579,7 +1579,7 @@ void Temperature::min_temp_error(const heater_id_t heater_id) {
15791579
void Temperature::manage_heated_bed(const millis_t &ms) {
15801580

15811581
#if ENABLED(THERMAL_PROTECTION_BED)
1582-
if (degBed() > BED_MAXTEMP) max_temp_error(H_BED);
1582+
if (degBed() > BED_MAXTEMP) maxtemp_error(H_BED);
15831583
#endif
15841584

15851585
#if WATCH_BED
@@ -1661,7 +1661,7 @@ void Temperature::min_temp_error(const heater_id_t heater_id) {
16611661
#endif
16621662

16631663
#if ENABLED(THERMAL_PROTECTION_CHAMBER)
1664-
if (degChamber() > CHAMBER_MAXTEMP) max_temp_error(H_CHAMBER);
1664+
if (degChamber() > CHAMBER_MAXTEMP) maxtemp_error(H_CHAMBER);
16651665
#endif
16661666

16671667
#if WATCH_CHAMBER
@@ -1788,7 +1788,7 @@ void Temperature::min_temp_error(const heater_id_t heater_id) {
17881788
#endif
17891789

17901790
#if ENABLED(THERMAL_PROTECTION_COOLER)
1791-
if (degCooler() > COOLER_MAXTEMP) max_temp_error(H_COOLER);
1791+
if (degCooler() > COOLER_MAXTEMP) maxtemp_error(H_COOLER);
17921792
#endif
17931793

17941794
#if WATCH_COOLER
@@ -1880,20 +1880,20 @@ void Temperature::task() {
18801880

18811881
#if DISABLED(IGNORE_THERMOCOUPLE_ERRORS)
18821882
#if TEMP_SENSOR_IS_MAX_TC(0)
1883-
if (degHotend(0) > _MIN(HEATER_0_MAXTEMP, TEMP_SENSOR_0_MAX_TC_TMAX - 1.0)) max_temp_error(H_E0);
1884-
if (degHotend(0) < _MAX(HEATER_0_MINTEMP, TEMP_SENSOR_0_MAX_TC_TMIN + .01)) min_temp_error(H_E0);
1883+
if (degHotend(0) > _MIN(HEATER_0_MAXTEMP, TEMP_SENSOR_0_MAX_TC_TMAX - 1.0)) maxtemp_error(H_E0);
1884+
if (degHotend(0) < _MAX(HEATER_0_MINTEMP, TEMP_SENSOR_0_MAX_TC_TMIN + .01)) mintemp_error(H_E0);
18851885
#endif
18861886
#if TEMP_SENSOR_IS_MAX_TC(1)
1887-
if (degHotend(1) > _MIN(HEATER_1_MAXTEMP, TEMP_SENSOR_1_MAX_TC_TMAX - 1.0)) max_temp_error(H_E1);
1888-
if (degHotend(1) < _MAX(HEATER_1_MINTEMP, TEMP_SENSOR_1_MAX_TC_TMIN + .01)) min_temp_error(H_E1);
1887+
if (degHotend(1) > _MIN(HEATER_1_MAXTEMP, TEMP_SENSOR_1_MAX_TC_TMAX - 1.0)) maxtemp_error(H_E1);
1888+
if (degHotend(1) < _MAX(HEATER_1_MINTEMP, TEMP_SENSOR_1_MAX_TC_TMIN + .01)) mintemp_error(H_E1);
18891889
#endif
18901890
#if TEMP_SENSOR_IS_MAX_TC(2)
1891-
if (degHotend(2) > _MIN(HEATER_2_MAXTEMP, TEMP_SENSOR_2_MAX_TC_TMAX - 1.0)) max_temp_error(H_E2);
1892-
if (degHotend(2) < _MAX(HEATER_2_MINTEMP, TEMP_SENSOR_2_MAX_TC_TMIN + .01)) min_temp_error(H_E2);
1891+
if (degHotend(2) > _MIN(HEATER_2_MAXTEMP, TEMP_SENSOR_2_MAX_TC_TMAX - 1.0)) maxtemp_error(H_E2);
1892+
if (degHotend(2) < _MAX(HEATER_2_MINTEMP, TEMP_SENSOR_2_MAX_TC_TMIN + .01)) mintemp_error(H_E2);
18931893
#endif
18941894
#if TEMP_SENSOR_IS_MAX_TC(REDUNDANT)
1895-
if (degRedundant() > TEMP_SENSOR_REDUNDANT_MAX_TC_TMAX - 1.0) max_temp_error(H_REDUNDANT);
1896-
if (degRedundant() < TEMP_SENSOR_REDUNDANT_MAX_TC_TMIN + .01) min_temp_error(H_REDUNDANT);
1895+
if (degRedundant() > TEMP_SENSOR_REDUNDANT_MAX_TC_TMAX - 1.0) maxtemp_error(H_REDUNDANT);
1896+
if (degRedundant() < TEMP_SENSOR_REDUNDANT_MAX_TC_TMIN + .01) mintemp_error(H_REDUNDANT);
18971897
#endif
18981898
#else
18991899
#warning "Safety Alert! Disable IGNORE_THERMOCOUPLE_ERRORS for the final build!"
@@ -2404,7 +2404,7 @@ void Temperature::updateTemperaturesFromRawValues() {
24042404
const raw_adc_t r = temp_hotend[e].getraw();
24052405
const bool neg = temp_dir[e] < 0, pos = temp_dir[e] > 0;
24062406
if ((neg && r < temp_range[e].raw_max) || (pos && r > temp_range[e].raw_max))
2407-
max_temp_error((heater_id_t)e);
2407+
maxtemp_error((heater_id_t)e);
24082408

24092409
/**
24102410
// DEBUG PREHEATING TIME
@@ -2416,7 +2416,7 @@ void Temperature::updateTemperaturesFromRawValues() {
24162416
const bool heater_on = temp_hotend[e].target > 0;
24172417
if (heater_on && !is_preheating(e) && ((neg && r > temp_range[e].raw_min) || (pos && r < temp_range[e].raw_min))) {
24182418
if (TERN1(MULTI_MAX_CONSECUTIVE_LOW_TEMP_ERR, ++consecutive_low_temperature_error[e] >= MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED))
2419-
min_temp_error((heater_id_t)e);
2419+
mintemp_error((heater_id_t)e);
24202420
}
24212421
else {
24222422
TERN_(MULTI_MAX_CONSECUTIVE_LOW_TEMP_ERR, consecutive_low_temperature_error[e] = 0);
@@ -2427,23 +2427,23 @@ void Temperature::updateTemperaturesFromRawValues() {
24272427

24282428
#define TP_CMP(S,A,B) (TEMPDIR(S) < 0 ? ((A)<(B)) : ((A)>(B)))
24292429
#if ENABLED(THERMAL_PROTECTION_BED)
2430-
if (TP_CMP(BED, temp_bed.getraw(), maxtemp_raw_BED)) max_temp_error(H_BED);
2431-
if (temp_bed.target > 0 && TP_CMP(BED, mintemp_raw_BED, temp_bed.getraw())) min_temp_error(H_BED);
2430+
if (TP_CMP(BED, temp_bed.getraw(), maxtemp_raw_BED)) maxtemp_error(H_BED);
2431+
if (temp_bed.target > 0 && TP_CMP(BED, mintemp_raw_BED, temp_bed.getraw())) mintemp_error(H_BED);
24322432
#endif
24332433

24342434
#if BOTH(HAS_HEATED_CHAMBER, THERMAL_PROTECTION_CHAMBER)
2435-
if (TP_CMP(CHAMBER, temp_chamber.getraw(), maxtemp_raw_CHAMBER)) max_temp_error(H_CHAMBER);
2436-
if (temp_chamber.target > 0 && TP_CMP(CHAMBER, mintemp_raw_CHAMBER, temp_chamber.getraw())) min_temp_error(H_CHAMBER);
2435+
if (TP_CMP(CHAMBER, temp_chamber.getraw(), maxtemp_raw_CHAMBER)) maxtemp_error(H_CHAMBER);
2436+
if (temp_chamber.target > 0 && TP_CMP(CHAMBER, mintemp_raw_CHAMBER, temp_chamber.getraw())) mintemp_error(H_CHAMBER);
24372437
#endif
24382438

24392439
#if BOTH(HAS_COOLER, THERMAL_PROTECTION_COOLER)
2440-
if (cutter.unitPower > 0 && TP_CMP(COOLER, temp_cooler.getraw(), maxtemp_raw_COOLER)) max_temp_error(H_COOLER);
2441-
if (TP_CMP(COOLER, mintemp_raw_COOLER, temp_cooler.getraw())) min_temp_error(H_COOLER);
2440+
if (cutter.unitPower > 0 && TP_CMP(COOLER, temp_cooler.getraw(), maxtemp_raw_COOLER)) maxtemp_error(H_COOLER);
2441+
if (TP_CMP(COOLER, mintemp_raw_COOLER, temp_cooler.getraw())) mintemp_error(H_COOLER);
24422442
#endif
24432443

24442444
#if BOTH(HAS_TEMP_BOARD, THERMAL_PROTECTION_BOARD)
2445-
if (TP_CMP(BOARD, temp_board.getraw(), maxtemp_raw_BOARD)) max_temp_error(H_BOARD);
2446-
if (TP_CMP(BOARD, mintemp_raw_BOARD, temp_board.getraw())) min_temp_error(H_BOARD);
2445+
if (TP_CMP(BOARD, temp_board.getraw(), maxtemp_raw_BOARD)) maxtemp_error(H_BOARD);
2446+
if (TP_CMP(BOARD, mintemp_raw_BOARD, temp_board.getraw())) mintemp_error(H_BOARD);
24472447
#endif
24482448
#undef TP_CMP
24492449

@@ -3161,7 +3161,7 @@ void Temperature::disable_all_heaters() {
31613161
#endif
31623162

31633163
// Handle an error. If there have been more than THERMOCOUPLE_MAX_ERRORS, send an error over serial.
3164-
// Either way, return the TMAX for the thermocouple to trigger a max_temp_error()
3164+
// Either way, return the TMAX for the thermocouple to trigger a maxtemp_error()
31653165
if (max_tc_temp & MAX_TC_ERROR_MASK) {
31663166
max_tc_errors[hindex]++;
31673167

Marlin/src/module/temperature.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1135,8 +1135,8 @@ class Temperature {
11351135
#endif
11361136

11371137
static void _temp_error(const heater_id_t e, FSTR_P const serial_msg, FSTR_P const lcd_msg);
1138-
static void min_temp_error(const heater_id_t e);
1139-
static void max_temp_error(const heater_id_t e);
1138+
static void mintemp_error(const heater_id_t e);
1139+
static void maxtemp_error(const heater_id_t e);
11401140

11411141
#define HAS_THERMAL_PROTECTION ANY(THERMAL_PROTECTION_HOTENDS, THERMAL_PROTECTION_CHAMBER, THERMAL_PROTECTION_BED, THERMAL_PROTECTION_COOLER)
11421142

0 commit comments

Comments
 (0)