Skip to content

Commit bb4efcf

Browse files
AnHardtWackerbarth
authored andcommitted
Handle temp callbacks when THERMAL_PROTECTION_HOTENDS is not defined
by alternate definition for the callback macros
1 parent 96d0d04 commit bb4efcf

File tree

1 file changed

+24
-10
lines changed

1 file changed

+24
-10
lines changed

Diff for: Marlin/ultralcd.cpp

+24-10
Original file line numberDiff line numberDiff line change
@@ -477,19 +477,33 @@ void lcd_set_home_offsets() {
477477
/**
478478
* Watch temperature callbacks
479479
*/
480-
#if TEMP_SENSOR_0 != 0
481-
void watch_temp_callback_E0() { start_watching_heater(0); }
482-
#endif
483-
#if EXTRUDERS > 1 && TEMP_SENSOR_1 != 0
484-
void watch_temp_callback_E1() { start_watching_heater(1); }
480+
#if ENABLED(THERMAL_PROTECTION_HOTENDS)
481+
#if TEMP_SENSOR_0 != 0
482+
void watch_temp_callback_E0() { start_watching_heater(0); }
483+
#endif
484+
#if EXTRUDERS > 1 && TEMP_SENSOR_1 != 0
485+
void watch_temp_callback_E1() { start_watching_heater(1); }
486+
#endif // EXTRUDERS > 1
485487
#if EXTRUDERS > 2 && TEMP_SENSOR_2 != 0
486488
void watch_temp_callback_E2() { start_watching_heater(2); }
487-
#if EXTRUDERS > 3 && TEMP_SENSOR_3 != 0
488-
void watch_temp_callback_E3() { start_watching_heater(3); }
489-
#endif // EXTRUDERS > 3
490489
#endif // EXTRUDERS > 2
491-
#endif // EXTRUDERS > 1
492-
490+
#if EXTRUDERS > 3 && TEMP_SENSOR_3 != 0
491+
void watch_temp_callback_E3() { start_watching_heater(3); }
492+
#endif // EXTRUDERS > 3
493+
#else
494+
#if TEMP_SENSOR_0 != 0
495+
void watch_temp_callback_E0() {}
496+
#endif
497+
#if EXTRUDERS > 1 && TEMP_SENSOR_1 != 0
498+
void watch_temp_callback_E1() {}
499+
#endif // EXTRUDERS > 1
500+
#if EXTRUDERS > 2 && TEMP_SENSOR_2 != 0
501+
void watch_temp_callback_E2() {}
502+
#endif // EXTRUDERS > 2
503+
#if EXTRUDERS > 3 && TEMP_SENSOR_3 != 0
504+
void watch_temp_callback_E3() {}
505+
#endif // EXTRUDERS > 3
506+
#endif
493507
/**
494508
* Items shared between Tune and Temperature menus
495509
*/

0 commit comments

Comments
 (0)