Skip to content

Commit

Permalink
Clear menu history for browse media on insert (MarlinFirmware#20236)
Browse files Browse the repository at this point in the history
Co-authored-by: Scott Lahteine <[email protected]>
  • Loading branch information
2 people authored and tharts committed Jan 6, 2021
1 parent 638cb95 commit e328e3c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions Marlin/src/lcd/marlinui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1625,6 +1625,7 @@ void MarlinUI::update() {
if (old_status < 2) {
TERN_(EXTENSIBLE_UI, ExtUI::onMediaInserted()); // ExtUI response
#if ENABLED(BROWSE_MEDIA_ON_INSERT)
clear_menu_history();
quick_feedback();
goto_screen(MEDIA_MENU_GATEWAY);
#else
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/menu/menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,8 @@ void MarlinUI::goto_screen(screenFunc_t screen, const uint16_t encoder/*=0*/, co
screen_items = items;
if (on_status_screen()) {
defer_status_screen(false);
clear_menu_history();
TERN_(AUTO_BED_LEVELING_UBL, ubl.lcd_map_control = false);
screen_history_depth = 0;
}

clear_lcd();
Expand Down
3 changes: 3 additions & 0 deletions Marlin/src/lcd/menu/menu.h
Original file line number Diff line number Diff line change
Expand Up @@ -249,3 +249,6 @@ void _lcd_draw_homing();
#if ENABLED(TOUCH_SCREEN_CALIBRATION)
void touch_screen_calibration();
#endif

extern uint8_t screen_history_depth;
inline void clear_menu_history() { screen_history_depth = 0; }
2 changes: 0 additions & 2 deletions Marlin/src/lcd/menu/menu_media.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,6 @@ class MenuItem_sdfolder : public MenuItem_sdbase {
}
};

extern uint8_t screen_history_depth;

void menu_media() {
ui.encoder_direction_menus();

Expand Down

0 comments on commit e328e3c

Please sign in to comment.