From 69f211cf78c1b25469fbd1f6e4c28e0aa6dd6b0a Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 23 Apr 2020 15:14:32 -0500 Subject: [PATCH] Add empty ui.completion_feedback --- Marlin/src/lcd/menu/menu.cpp | 4 ++-- Marlin/src/lcd/menu/menu_advanced.cpp | 2 +- Marlin/src/lcd/menu/menu_bed_leveling.cpp | 10 ++-------- Marlin/src/lcd/menu/menu_cancelobject.cpp | 2 +- Marlin/src/lcd/menu/menu_configuration.cpp | 5 +---- Marlin/src/lcd/menu/menu_main.cpp | 2 +- Marlin/src/lcd/ultralcd.h | 2 ++ 7 files changed, 10 insertions(+), 17 deletions(-) diff --git a/Marlin/src/lcd/menu/menu.cpp b/Marlin/src/lcd/menu/menu.cpp index 1698c7d7ad..1518e1f50a 100644 --- a/Marlin/src/lcd/menu/menu.cpp +++ b/Marlin/src/lcd/menu/menu.cpp @@ -413,12 +413,12 @@ void scroll_screen(const uint8_t limit, const bool is_menu) { #if ENABLED(EEPROM_SETTINGS) void lcd_store_settings() { const bool saved = settings.save(); - TERN_(HAS_BUZZER, ui.completion_feedback(saved)); + ui.completion_feedback(saved); UNUSED(saved); } void lcd_load_settings() { const bool loaded = settings.load(); - TERN_(HAS_BUZZER, ui.completion_feedback(loaded)); + ui.completion_feedback(loaded); UNUSED(loaded); } #endif diff --git a/Marlin/src/lcd/menu/menu_advanced.cpp b/Marlin/src/lcd/menu/menu_advanced.cpp index 28d8411940..4f85976d7d 100644 --- a/Marlin/src/lcd/menu/menu_advanced.cpp +++ b/Marlin/src/lcd/menu/menu_advanced.cpp @@ -587,7 +587,7 @@ void menu_advanced_settings() { MSG_BUTTON_INIT, MSG_BUTTON_CANCEL, []{ const bool inited = settings.init_eeprom(); - TERN_(HAS_BUZZER, ui.completion_feedback(inited)); + ui.completion_feedback(inited); UNUSED(inited); }, ui.goto_previous_screen, diff --git a/Marlin/src/lcd/menu/menu_bed_leveling.cpp b/Marlin/src/lcd/menu/menu_bed_leveling.cpp index 54a9cb5c23..fa7d099d15 100644 --- a/Marlin/src/lcd/menu/menu_bed_leveling.cpp +++ b/Marlin/src/lcd/menu/menu_bed_leveling.cpp @@ -48,13 +48,7 @@ static uint8_t manual_probe_index; // LCD probed points are from defaults - constexpr uint8_t total_probe_points = ( - #if ENABLED(AUTO_BED_LEVELING_3POINT) - 3 - #elif ABL_GRID || ENABLED(MESH_BED_LEVELING) - GRID_MAX_POINTS - #endif - ); + constexpr uint8_t total_probe_points = TERN(AUTO_BED_LEVELING_3POINT, 3, GRID_MAX_POINTS); // // Bed leveling is done. Wait for G29 to complete. @@ -75,7 +69,7 @@ ui.synchronize(GET_TEXT(MSG_LEVEL_BED_DONE)); #endif ui.goto_previous_screen_no_defer(); - TERN_(HAS_BUZZER, ui.completion_feedback()); + ui.completion_feedback(); } if (ui.should_draw()) MenuItem_static::draw(LCD_HEIGHT >= 4, GET_TEXT(MSG_LEVEL_BED_DONE)); ui.refresh(LCDVIEW_CALL_REDRAW_NEXT); diff --git a/Marlin/src/lcd/menu/menu_cancelobject.cpp b/Marlin/src/lcd/menu/menu_cancelobject.cpp index 398dd10e2c..8b7bfc8a5c 100644 --- a/Marlin/src/lcd/menu/menu_cancelobject.cpp +++ b/Marlin/src/lcd/menu/menu_cancelobject.cpp @@ -44,7 +44,7 @@ static void lcd_cancel_object_confirm() { MenuItem_confirm::confirm_screen( []{ cancelable.cancel_object(MenuItemBase::itemIndex - 1); - TERN_(HAS_BUZZER, ui.completion_feedback()); + ui.completion_feedback(); ui.goto_previous_screen(); }, ui.goto_previous_screen, diff --git a/Marlin/src/lcd/menu/menu_configuration.cpp b/Marlin/src/lcd/menu/menu_configuration.cpp index bf7be4dbc2..cb7360d09b 100644 --- a/Marlin/src/lcd/menu/menu_configuration.cpp +++ b/Marlin/src/lcd/menu/menu_configuration.cpp @@ -450,10 +450,7 @@ void menu_configuration() { #endif if (!busy) - ACTION_ITEM(MSG_RESTORE_DEFAULTS, []{ - settings.reset(); - TERN_(HAS_BUZZER, ui.completion_feedback()); - }); + ACTION_ITEM(MSG_RESTORE_DEFAULTS, []{ settings.reset(); ui.completion_feedback(); }); END_MENU(); } diff --git a/Marlin/src/lcd/menu/menu_main.cpp b/Marlin/src/lcd/menu/menu_main.cpp index 4c17208b25..47873b1f44 100644 --- a/Marlin/src/lcd/menu/menu_main.cpp +++ b/Marlin/src/lcd/menu/menu_main.cpp @@ -239,7 +239,7 @@ void menu_main() { #if HAS_SERVICE_INTERVALS static auto _service_reset = [](const int index) { print_job_timer.resetServiceInterval(index); - TERN_(HAS_BUZZER, ui.completion_feedback()); + ui.completion_feedback(); ui.reset_status(); ui.return_to_status(); }; diff --git a/Marlin/src/lcd/ultralcd.h b/Marlin/src/lcd/ultralcd.h index 5a4805edf7..1258d9f30e 100644 --- a/Marlin/src/lcd/ultralcd.h +++ b/Marlin/src/lcd/ultralcd.h @@ -397,6 +397,8 @@ public: static void quick_feedback(const bool clear_buttons=true); #if HAS_BUZZER static void completion_feedback(const bool good=true); + #else + static inline void completion_feedback(const bool=true) {} #endif #if DISABLED(LIGHTWEIGHT_UI)