Skip to content

Commit

Permalink
🐛 Use setTargetHotend in menus (#22247)
Browse files Browse the repository at this point in the history
  • Loading branch information
slowbro authored and thinkyhead committed Jun 28, 2021
1 parent 1f6768a commit e3d98dd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
17 changes: 9 additions & 8 deletions Marlin/src/lcd/menu/menu.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,15 @@ class MenuItem_confirm : public MenuItemBase {

// The Menu Edit shadow value
typedef union {
bool state;
float decimal;
int8_t int8;
int16_t int16;
int32_t int32;
uint8_t uint8;
uint16_t uint16;
uint32_t uint32;
bool state;
float decimal;
int8_t int8;
int16_t int16;
int32_t int32;
uint8_t uint8;
uint16_t uint16;
uint32_t uint32;
celsius_t celsius;
} chimera_t;
extern chimera_t editable;

Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/lcd/menu/menu_temperature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,10 @@ void menu_temperature() {
// Nozzle [1-5]:
//
#if HOTENDS == 1
EDIT_ITEM_FAST(int3, MSG_NOZZLE, &thermalManager.temp_hotend[0].target, 0, thermalManager.hotend_max_target(0), []{ thermalManager.start_watching_hotend(0); });
EDIT_ITEM_FAST(int3, MSG_NOZZLE, &thermalManager.temp_hotend[0].target, 0, thermalManager.hotend_max_target(0), []{ thermalManager.setTargetHotend(thermalManager.temp_hotend[0].target, 0); });

This comment has been minimized.

Copy link
@slowbro

slowbro Jun 28, 2021

Author Member

The problem I ran into with setTargetHotend(thermalManager.temp_hotend[0].target, 0); is that the check in setTargetHotend will only prime the preheat delay if the target was previously 0. So, this would result in the same issue (immediate MIN TEMP error) since it will have been modified by TMenuEditItem::action().

#elif HAS_MULTI_HOTEND
HOTEND_LOOP()
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); });
EDIT_ITEM_FAST_N(int3, e, MSG_NOZZLE_N, &thermalManager.temp_hotend[e].target, 0, thermalManager.hotend_max_target(e), []{ int8_t e = MenuItemBase::itemIndex; thermalManager.setTargetHotend(thermalManager.temp_hotend[e].target, e); });
#endif

#if ENABLED(SINGLENOZZLE_STANDBY_TEMP)
Expand Down

0 comments on commit e3d98dd

Please sign in to comment.