Skip to content

Commit 6ea6556

Browse files
slowbrothinkyhead
authored andcommitted
🐛 Use setTargetHotend in menus (MarlinFirmware#22247)
1 parent 2b37a71 commit 6ea6556

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

Marlin/src/lcd/menu/menu.h

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -132,14 +132,15 @@ class MenuItem_confirm : public MenuItemBase {
132132

133133
// The Menu Edit shadow value
134134
typedef union {
135-
bool state;
136-
float decimal;
137-
int8_t int8;
138-
int16_t int16;
139-
int32_t int32;
140-
uint8_t uint8;
141-
uint16_t uint16;
142-
uint32_t uint32;
135+
bool state;
136+
float decimal;
137+
int8_t int8;
138+
int16_t int16;
139+
int32_t int32;
140+
uint8_t uint8;
141+
uint16_t uint16;
142+
uint32_t uint32;
143+
celsius_t celsius;
143144
} chimera_t;
144145
extern chimera_t editable;
145146

Marlin/src/lcd/menu/menu_temperature.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,13 @@ void menu_temperature() {
169169
// Nozzle [1-5]:
170170
//
171171
#if HOTENDS == 1
172-
EDIT_ITEM_FAST(int3, MSG_NOZZLE, &thermalManager.temp_hotend[0].target, 0, thermalManager.hotend_max_target(0), []{ thermalManager.start_watching_hotend(0); });
172+
editable.celsius = thermalManager.temp_hotend[0].target;
173+
EDIT_ITEM_FAST(int3, MSG_NOZZLE, &editable.celsius, 0, thermalManager.hotend_max_target(0), []{ thermalManager.setTargetHotend(editable.celsius, 0); });
173174
#elif HAS_MULTI_HOTEND
174-
HOTEND_LOOP()
175-
EDIT_ITEM_FAST_N(int3, e, MSG_NOZZLE_N, &thermalManager.temp_hotend[e].target, 0, thermalManager.hotend_max_target(e), []{ thermalManager.start_watching_hotend(MenuItemBase::itemIndex); });
175+
HOTEND_LOOP() {
176+
editable.celsius = thermalManager.temp_hotend[e].target;
177+
EDIT_ITEM_FAST_N(int3, e, MSG_NOZZLE_N, &editable.celsius, 0, thermalManager.hotend_max_target(e), []{ thermalManager.setTargetHotend(editable.celsius, MenuItemBase::itemIndex); });
178+
}
176179
#endif
177180

178181
#if ENABLED(SINGLENOZZLE_STANDBY_TEMP)

0 commit comments

Comments
 (0)