From a82b95dcf29324cb3000e2f3a453cf5d85ba5af7 Mon Sep 17 00:00:00 2001 From: Marcio Teixeira Date: Wed, 21 Aug 2019 09:30:07 -0600 Subject: [PATCH 1/2] Fix compile error when using TURBO_BACK_MENU_ITEM - Some menu items require "ui.goto_previous_function" to be pointed to by "void (*)()" and using a default parameter would change the function signature. --- Marlin/src/lcd/ultralcd.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Marlin/src/lcd/ultralcd.h b/Marlin/src/lcd/ultralcd.h index 565ff2f79278..375b02a50956 100644 --- a/Marlin/src/lcd/ultralcd.h +++ b/Marlin/src/lcd/ultralcd.h @@ -449,10 +449,16 @@ class MarlinUI { static void save_previous_screen(); static void goto_previous_screen( #if ENABLED(TURBO_BACK_MENU_ITEM) - const bool is_back=false + const bool is_back #endif ); + #if ENABLED(TURBO_BACK_MENU_ITEM) + // Various menu items require a "void (*)()" to point to + // this function so a default argument will *not* work + static void goto_previous_screen() {goto_previous_screen(false);} + #endif + static void return_to_status(); static inline bool on_status_screen() { return currentScreen == status_screen; } static inline void run_current_screen() { (*currentScreen)(); } From ed6e8b30f80af3c6cecd6d5e6c1e115c1c3c33ba Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 23 Aug 2019 22:23:05 -0500 Subject: [PATCH 2/2] Update ultralcd.h --- Marlin/src/lcd/ultralcd.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/src/lcd/ultralcd.h b/Marlin/src/lcd/ultralcd.h index 375b02a50956..9c9084dd766b 100644 --- a/Marlin/src/lcd/ultralcd.h +++ b/Marlin/src/lcd/ultralcd.h @@ -455,8 +455,8 @@ class MarlinUI { #if ENABLED(TURBO_BACK_MENU_ITEM) // Various menu items require a "void (*)()" to point to - // this function so a default argument will *not* work - static void goto_previous_screen() {goto_previous_screen(false);} + // this function so a default argument *won't* work + static inline void goto_previous_screen() { goto_previous_screen(false); } #endif static void return_to_status();