Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix MarlinUI temporary allow cold extrude #24176

Merged
merged 2 commits into from
May 17, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions Marlin/src/lcd/menu/menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,6 @@ void MenuEditItemBase::goto_edit_screen(
*/
void MarlinUI::goto_screen(screenFunc_t screen, const uint16_t encoder/*=0*/, const uint8_t top/*=0*/, const uint8_t items/*=0*/) {
if (currentScreen != screen) {
thermalManager.set_menu_cold_override(false);
Copy link
Member

@thinkyhead thinkyhead May 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is here to make sure the flag gets set to false whenever the move screen is exited (so, whenever the screen is changed), otherwise the flag will be stuck in the true state. As long as set_menu_cold_override is called after _goto_menu_move_distance_e the desired result should be achieved (assuming there are no sub-screens).

The call to set_menu_cold_override(false) that's being added to menu_move (below) won't do the trick. It only resets the flag to false in the event the user enters (or returns to) the Move menu, which is not guaranteed. It doesn't handle timeout to status screen or the case of some incoming G-code command changing the screen. Setting it to false here in goto_screen is expected to be totally reliable.

So, we need a better understanding why the current pattern is failing. Where else is the flag getting set to false? Is goto_screen called a second time by some quirk? What does investigation with SERIAL_ECHO (or GDB) tell us?


TERN_(IS_DWIN_MARLINUI, did_first_redraw = false);

TERN_(HAS_TOUCH_BUTTONS, repeat_delay = BUTTON_DELAY_MENU);
Expand Down
4 changes: 3 additions & 1 deletion Marlin/src/lcd/menu/menu_motion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ void _menu_move_distance(const AxisEnum axis, const screenFunc_t func, const int
ui.goto_screen([]{
MenuItem_confirm::select_screen(
GET_TEXT(MSG_BUTTON_PROCEED), GET_TEXT(MSG_BACK),
[] { _goto_menu_move_distance_e(); thermalManager.set_menu_cold_override(true); }, nullptr,
[] { thermalManager.set_menu_cold_override(true); _goto_menu_move_distance_e(); }, nullptr,
GET_TEXT(MSG_HOTEND_TOO_COLD), (const char *)nullptr, PSTR("!")
);
});
Expand Down Expand Up @@ -323,6 +323,8 @@ void menu_move() {

#if E_MANUAL

thermalManager.set_menu_cold_override(false);

// The current extruder
SUBMENU(MSG_MOVE_E, []{ _menu_move_distance_e_maybe(); });

Expand Down