Skip to content

Commit 5e77760

Browse files
authored
Add TURBO_BACK_MENU_ITEM option (MarlinFirmware#14991)
1 parent 0cc524b commit 5e77760

File tree

102 files changed

+323
-4
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+323
-4
lines changed

Marlin/Configuration_adv.h

+3
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,9 @@
859859
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
860860
#endif
861861

862+
// BACK menu items keep the highlight at the top
863+
//#define TURBO_BACK_MENU_ITEM
864+
862865
/**
863866
* LED Control Menu
864867
* Add LED Control to the LCD menu

Marlin/src/lcd/menu/menu.cpp

+13-2
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,21 @@ void MarlinUI::save_previous_screen() {
8888
screen_history[screen_history_depth++] = { currentScreen, encoderPosition, encoderTopLine, screen_items };
8989
}
9090

91-
void MarlinUI::goto_previous_screen() {
91+
void MarlinUI::goto_previous_screen(
92+
#if ENABLED(TURBO_BACK_MENU_ITEM)
93+
const bool is_back/*=false*/
94+
#endif
95+
) {
96+
#if DISABLED(TURBO_BACK_MENU_ITEM)
97+
constexpr bool is_back = false;
98+
#endif
9299
if (screen_history_depth > 0) {
93100
menuPosition &sh = screen_history[--screen_history_depth];
94-
goto_screen(sh.menu_function, sh.encoder_position, sh.top_line, sh.items);
101+
goto_screen(sh.menu_function,
102+
is_back ? 0 : sh.encoder_position,
103+
is_back ? 0 : sh.top_line,
104+
sh.items
105+
);
95106
}
96107
else
97108
return_to_status();

Marlin/src/lcd/menu/menu.h

+7-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,13 @@ DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(long5_25); // 12345 right-justif
144144

145145
class MenuItem_back {
146146
public:
147-
static inline void action() { ui.goto_previous_screen(); }
147+
static inline void action() {
148+
ui.goto_previous_screen(
149+
#if ENABLED(TURBO_BACK_MENU_ITEM)
150+
true
151+
#endif
152+
);
153+
}
148154
};
149155

150156
class MenuItem_submenu {

Marlin/src/lcd/ultralcd.h

+6-1
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,12 @@ class MarlinUI {
447447
static screenFunc_t currentScreen;
448448
static void goto_screen(const screenFunc_t screen, const uint16_t encoder=0, const uint8_t top=0, const uint8_t items=0);
449449
static void save_previous_screen();
450-
static void goto_previous_screen();
450+
static void goto_previous_screen(
451+
#if ENABLED(TURBO_BACK_MENU_ITEM)
452+
const bool is_back=false
453+
#endif
454+
);
455+
451456
static void return_to_status();
452457
static inline bool on_status_screen() { return currentScreen == status_screen; }
453458
static inline void run_current_screen() { (*currentScreen)(); }

config/default/Configuration_adv.h

+3
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,9 @@
859859
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
860860
#endif
861861

862+
// BACK menu items keep the highlight at the top
863+
//#define TURBO_BACK_MENU_ITEM
864+
862865
/**
863866
* LED Control Menu
864867
* Add LED Control to the LCD menu

config/examples/3DFabXYZ/Migbot/Configuration_adv.h

+3
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,9 @@
859859
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
860860
#endif
861861

862+
// BACK menu items keep the highlight at the top
863+
//#define TURBO_BACK_MENU_ITEM
864+
862865
/**
863866
* LED Control Menu
864867
* Add LED Control to the LCD menu

config/examples/AlephObjects/TAZ4/Configuration_adv.h

+3
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,9 @@
859859
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
860860
#endif
861861

862+
// BACK menu items keep the highlight at the top
863+
//#define TURBO_BACK_MENU_ITEM
864+
862865
/**
863866
* LED Control Menu
864867
* Add LED Control to the LCD menu

config/examples/Alfawise/U20/Configuration_adv.h

+3
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,9 @@
859859
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
860860
#endif
861861

862+
// BACK menu items keep the highlight at the top
863+
//#define TURBO_BACK_MENU_ITEM
864+
862865
/**
863866
* LED Control Menu
864867
* Add LED Control to the LCD menu

config/examples/AliExpress/UM2pExt/Configuration_adv.h

+3
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,9 @@
859859
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
860860
#endif
861861

862+
// BACK menu items keep the highlight at the top
863+
//#define TURBO_BACK_MENU_ITEM
864+
862865
/**
863866
* LED Control Menu
864867
* Add LED Control to the LCD menu

config/examples/Anet/A2/Configuration_adv.h

+3
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,9 @@
859859
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
860860
#endif
861861

862+
// BACK menu items keep the highlight at the top
863+
//#define TURBO_BACK_MENU_ITEM
864+
862865
/**
863866
* LED Control Menu
864867
* Add LED Control to the LCD menu

config/examples/Anet/A2plus/Configuration_adv.h

+3
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,9 @@
859859
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
860860
#endif
861861

862+
// BACK menu items keep the highlight at the top
863+
//#define TURBO_BACK_MENU_ITEM
864+
862865
/**
863866
* LED Control Menu
864867
* Add LED Control to the LCD menu

config/examples/Anet/A6/Configuration_adv.h

+3
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,9 @@
859859
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
860860
#endif
861861

862+
// BACK menu items keep the highlight at the top
863+
//#define TURBO_BACK_MENU_ITEM
864+
862865
/**
863866
* LED Control Menu
864867
* Add LED Control to the LCD menu

config/examples/Anet/A8/Configuration_adv.h

+3
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,9 @@
859859
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
860860
#endif
861861

862+
// BACK menu items keep the highlight at the top
863+
//#define TURBO_BACK_MENU_ITEM
864+
862865
/**
863866
* LED Control Menu
864867
* Add LED Control to the LCD menu

config/examples/Anet/A8plus/Configuration_adv.h

+3
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,9 @@
859859
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
860860
#endif
861861

862+
// BACK menu items keep the highlight at the top
863+
//#define TURBO_BACK_MENU_ITEM
864+
862865
/**
863866
* LED Control Menu
864867
* Add LED Control to the LCD menu

config/examples/Anet/E16/Configuration_adv.h

+3
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,9 @@
859859
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
860860
#endif
861861

862+
// BACK menu items keep the highlight at the top
863+
//#define TURBO_BACK_MENU_ITEM
864+
862865
/**
863866
* LED Control Menu
864867
* Add LED Control to the LCD menu

config/examples/AnyCubic/i3/Configuration_adv.h

+3
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,9 @@
859859
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
860860
#endif
861861

862+
// BACK menu items keep the highlight at the top
863+
//#define TURBO_BACK_MENU_ITEM
864+
862865
/**
863866
* LED Control Menu
864867
* Add LED Control to the LCD menu

config/examples/ArmEd/Configuration_adv.h

+3
Original file line numberDiff line numberDiff line change
@@ -863,6 +863,9 @@
863863
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
864864
#endif
865865

866+
// BACK menu items keep the highlight at the top
867+
//#define TURBO_BACK_MENU_ITEM
868+
866869
/**
867870
* LED Control Menu
868871
* Add LED Control to the LCD menu

config/examples/BIBO/TouchX/cyclops/Configuration_adv.h

+3
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,9 @@
859859
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
860860
#endif
861861

862+
// BACK menu items keep the highlight at the top
863+
//#define TURBO_BACK_MENU_ITEM
864+
862865
/**
863866
* LED Control Menu
864867
* Add LED Control to the LCD menu

config/examples/BIBO/TouchX/default/Configuration_adv.h

+3
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,9 @@
859859
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
860860
#endif
861861

862+
// BACK menu items keep the highlight at the top
863+
//#define TURBO_BACK_MENU_ITEM
864+
862865
/**
863866
* LED Control Menu
864867
* Add LED Control to the LCD menu

config/examples/BQ/Hephestos/Configuration_adv.h

+3
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,9 @@
859859
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
860860
#endif
861861

862+
// BACK menu items keep the highlight at the top
863+
//#define TURBO_BACK_MENU_ITEM
864+
862865
/**
863866
* LED Control Menu
864867
* Add LED Control to the LCD menu

config/examples/BQ/Hephestos_2/Configuration_adv.h

+3
Original file line numberDiff line numberDiff line change
@@ -867,6 +867,9 @@
867867
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
868868
#endif
869869

870+
// BACK menu items keep the highlight at the top
871+
//#define TURBO_BACK_MENU_ITEM
872+
870873
/**
871874
* LED Control Menu
872875
* Add LED Control to the LCD menu

config/examples/BQ/WITBOX/Configuration_adv.h

+3
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,9 @@
859859
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
860860
#endif
861861

862+
// BACK menu items keep the highlight at the top
863+
//#define TURBO_BACK_MENU_ITEM
864+
862865
/**
863866
* LED Control Menu
864867
* Add LED Control to the LCD menu

config/examples/Cartesio/Configuration_adv.h

+3
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,9 @@
859859
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
860860
#endif
861861

862+
// BACK menu items keep the highlight at the top
863+
//#define TURBO_BACK_MENU_ITEM
864+
862865
/**
863866
* LED Control Menu
864867
* Add LED Control to the LCD menu

config/examples/Creality/CR-10/Configuration_adv.h

+3
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,9 @@
859859
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
860860
#endif
861861

862+
// BACK menu items keep the highlight at the top
863+
//#define TURBO_BACK_MENU_ITEM
864+
862865
/**
863866
* LED Control Menu
864867
* Add LED Control to the LCD menu

config/examples/Creality/CR-10S/Configuration_adv.h

+3
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,9 @@
859859
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
860860
#endif
861861

862+
// BACK menu items keep the highlight at the top
863+
//#define TURBO_BACK_MENU_ITEM
864+
862865
/**
863866
* LED Control Menu
864867
* Add LED Control to the LCD menu

config/examples/Creality/CR-10_5S/Configuration_adv.h

+3
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,9 @@
859859
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
860860
#endif
861861

862+
// BACK menu items keep the highlight at the top
863+
//#define TURBO_BACK_MENU_ITEM
864+
862865
/**
863866
* LED Control Menu
864867
* Add LED Control to the LCD menu

config/examples/Creality/CR-10mini/Configuration_adv.h

+3
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,9 @@
859859
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
860860
#endif
861861

862+
// BACK menu items keep the highlight at the top
863+
//#define TURBO_BACK_MENU_ITEM
864+
862865
/**
863866
* LED Control Menu
864867
* Add LED Control to the LCD menu

config/examples/Creality/CR-20 Pro/Configuration_adv.h

+3
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,9 @@
859859
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
860860
#endif
861861

862+
// BACK menu items keep the highlight at the top
863+
//#define TURBO_BACK_MENU_ITEM
864+
862865
/**
863866
* LED Control Menu
864867
* Add LED Control to the LCD menu

config/examples/Creality/CR-20/Configuration_adv.h

+3
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,9 @@
859859
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
860860
#endif
861861

862+
// BACK menu items keep the highlight at the top
863+
//#define TURBO_BACK_MENU_ITEM
864+
862865
/**
863866
* LED Control Menu
864867
* Add LED Control to the LCD menu

config/examples/Creality/CR-8/Configuration_adv.h

+3
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,9 @@
859859
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
860860
#endif
861861

862+
// BACK menu items keep the highlight at the top
863+
//#define TURBO_BACK_MENU_ITEM
864+
862865
/**
863866
* LED Control Menu
864867
* Add LED Control to the LCD menu

config/examples/Creality/Ender-2/Configuration_adv.h

+3
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,9 @@
859859
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
860860
#endif
861861

862+
// BACK menu items keep the highlight at the top
863+
//#define TURBO_BACK_MENU_ITEM
864+
862865
/**
863866
* LED Control Menu
864867
* Add LED Control to the LCD menu

config/examples/Creality/Ender-3/Configuration_adv.h

+3
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,9 @@
859859
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
860860
#endif
861861

862+
// BACK menu items keep the highlight at the top
863+
//#define TURBO_BACK_MENU_ITEM
864+
862865
/**
863866
* LED Control Menu
864867
* Add LED Control to the LCD menu

config/examples/Creality/Ender-4/Configuration_adv.h

+3
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,9 @@
859859
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
860860
#endif
861861

862+
// BACK menu items keep the highlight at the top
863+
//#define TURBO_BACK_MENU_ITEM
864+
862865
/**
863866
* LED Control Menu
864867
* Add LED Control to the LCD menu

config/examples/Creality/Ender-5/Configuration_adv.h

+3
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,9 @@
859859
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
860860
#endif
861861

862+
// BACK menu items keep the highlight at the top
863+
//#define TURBO_BACK_MENU_ITEM
864+
862865
/**
863866
* LED Control Menu
864867
* Add LED Control to the LCD menu

config/examples/Dagoma/Disco Ultimate/Configuration_adv.h

+3
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,9 @@
859859
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
860860
#endif
861861

862+
// BACK menu items keep the highlight at the top
863+
//#define TURBO_BACK_MENU_ITEM
864+
862865
/**
863866
* LED Control Menu
864867
* Add LED Control to the LCD menu

config/examples/EVNOVO (Artillery)/Sidewinder X1/Configuration_adv.h

+3
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,9 @@
859859
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
860860
#endif
861861

862+
// BACK menu items keep the highlight at the top
863+
//#define TURBO_BACK_MENU_ITEM
864+
862865
/**
863866
* LED Control Menu
864867
* Add LED Control to the LCD menu

config/examples/Einstart-S/Configuration_adv.h

+3
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,9 @@
859859
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
860860
#endif
861861

862+
// BACK menu items keep the highlight at the top
863+
//#define TURBO_BACK_MENU_ITEM
864+
862865
/**
863866
* LED Control Menu
864867
* Add LED Control to the LCD menu

0 commit comments

Comments
 (0)