Browse Source

🐛 Use setTargetHotend in menus (#22247)

Katelyn Schiesser 4 years ago
parent
commit
7888584fec
2 changed files with 15 additions and 11 deletions
  1. 9
    8
      Marlin/src/lcd/menu/menu.h
  2. 6
    3
      Marlin/src/lcd/menu/menu_temperature.cpp

+ 9
- 8
Marlin/src/lcd/menu/menu.h View File

@@ -132,14 +132,15 @@ class MenuItem_confirm : public MenuItemBase {
132 132
 
133 133
 // The Menu Edit shadow value
134 134
 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;
143 144
 } chimera_t;
144 145
 extern chimera_t editable;
145 146
 

+ 6
- 3
Marlin/src/lcd/menu/menu_temperature.cpp View File

@@ -169,10 +169,13 @@ void menu_temperature() {
169 169
   // Nozzle [1-5]:
170 170
   //
171 171
   #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); });
173 174
   #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
+    }
176 179
   #endif
177 180
 
178 181
   #if ENABLED(SINGLENOZZLE_STANDBY_TEMP)

Loading…
Cancel
Save