|
@@ -47,21 +47,27 @@ uint8_t MarlinUI::preheat_fan_speed[2];
|
47
|
47
|
// "Temperature" submenu items
|
48
|
48
|
//
|
49
|
49
|
|
50
|
|
-void _lcd_preheat(const int16_t endnum, const int16_t temph, const int16_t tempb, const uint8_t fan) {
|
|
50
|
+
|
|
51
|
+void Temperature::lcd_preheat(const int16_t e, const int8_t indh, const int8_t indb) {
|
51
|
52
|
#if HAS_HOTEND
|
52
|
|
- if (temph > 0) thermalManager.setTargetHotend(_MIN(heater_maxtemp[endnum] - 15, temph), endnum);
|
|
53
|
+ if (indh >= 0 && ui.preheat_hotend_temp[indh] > 0)
|
|
54
|
+ setTargetHotend(_MIN(heater_maxtemp[e] - 15, ui.preheat_hotend_temp[indh]), e);
|
|
55
|
+ #else
|
|
56
|
+ UNUSED(temph);
|
53
|
57
|
#endif
|
54
|
58
|
#if HAS_HEATED_BED
|
55
|
|
- if (tempb >= 0) thermalManager.setTargetBed(tempb);
|
|
59
|
+ if (indb >= 0 && ui.preheat_bed_temp[indb] >= 0) setTargetBed(ui.preheat_bed_temp[indb]);
|
56
|
60
|
#else
|
57
|
|
- UNUSED(tempb);
|
|
61
|
+ UNUSED(indb);
|
58
|
62
|
#endif
|
59
|
|
- #if FAN_COUNT > 0
|
60
|
|
- #if FAN_COUNT > 1
|
61
|
|
- thermalManager.set_fan_speed(active_extruder < FAN_COUNT ? active_extruder : 0, fan);
|
62
|
|
- #else
|
63
|
|
- thermalManager.set_fan_speed(0, fan);
|
64
|
|
- #endif
|
|
63
|
+ #if HAS_FAN
|
|
64
|
+ set_fan_speed((
|
|
65
|
+ #if FAN_COUNT > 1
|
|
66
|
+ active_extruder < FAN_COUNT ? active_extruder : 0
|
|
67
|
+ #else
|
|
68
|
+ 0
|
|
69
|
+ #endif
|
|
70
|
+ ), fan);
|
65
|
71
|
#else
|
66
|
72
|
UNUSED(fan);
|
67
|
73
|
#endif
|
|
@@ -70,17 +76,17 @@ void _lcd_preheat(const int16_t endnum, const int16_t temph, const int16_t tempb
|
70
|
76
|
|
71
|
77
|
#if HAS_TEMP_HOTEND
|
72
|
78
|
inline void _preheat_end(const uint8_t m, const uint8_t e) {
|
73
|
|
- _lcd_preheat(e, ui.preheat_hotend_temp[m], -1, ui.preheat_fan_speed[m]);
|
|
79
|
+ thermalManager.lcd_preheat(e, m, -1);
|
74
|
80
|
}
|
75
|
81
|
#if HAS_HEATED_BED
|
76
|
82
|
inline void _preheat_both(const uint8_t m, const uint8_t e) {
|
77
|
|
- _lcd_preheat(e, ui.preheat_hotend_temp[m], ui.preheat_bed_temp[m], ui.preheat_fan_speed[m]);
|
|
83
|
+ thermalManager.lcd_preheat(e, m, m);
|
78
|
84
|
}
|
79
|
85
|
#endif
|
80
|
86
|
#endif
|
81
|
87
|
#if HAS_HEATED_BED
|
82
|
88
|
inline void _preheat_bed(const uint8_t m) {
|
83
|
|
- _lcd_preheat(0, 0, ui.preheat_bed_temp[m], ui.preheat_fan_speed[m]);
|
|
89
|
+ thermalManager.lcd_preheat(-1, -1, m);
|
84
|
90
|
}
|
85
|
91
|
#endif
|
86
|
92
|
|