Add empty ui.completion_feedback

This commit is contained in:
Scott Lahteine 2020-04-23 15:14:32 -05:00
parent 239c45dc11
commit 69f211cf78
7 changed files with 10 additions and 17 deletions

View file

@ -413,12 +413,12 @@ void scroll_screen(const uint8_t limit, const bool is_menu) {
#if ENABLED(EEPROM_SETTINGS) #if ENABLED(EEPROM_SETTINGS)
void lcd_store_settings() { void lcd_store_settings() {
const bool saved = settings.save(); const bool saved = settings.save();
TERN_(HAS_BUZZER, ui.completion_feedback(saved)); ui.completion_feedback(saved);
UNUSED(saved); UNUSED(saved);
} }
void lcd_load_settings() { void lcd_load_settings() {
const bool loaded = settings.load(); const bool loaded = settings.load();
TERN_(HAS_BUZZER, ui.completion_feedback(loaded)); ui.completion_feedback(loaded);
UNUSED(loaded); UNUSED(loaded);
} }
#endif #endif

View file

@ -587,7 +587,7 @@ void menu_advanced_settings() {
MSG_BUTTON_INIT, MSG_BUTTON_CANCEL, MSG_BUTTON_INIT, MSG_BUTTON_CANCEL,
[]{ []{
const bool inited = settings.init_eeprom(); const bool inited = settings.init_eeprom();
TERN_(HAS_BUZZER, ui.completion_feedback(inited)); ui.completion_feedback(inited);
UNUSED(inited); UNUSED(inited);
}, },
ui.goto_previous_screen, ui.goto_previous_screen,

View file

@ -48,13 +48,7 @@
static uint8_t manual_probe_index; static uint8_t manual_probe_index;
// LCD probed points are from defaults // LCD probed points are from defaults
constexpr uint8_t total_probe_points = ( constexpr uint8_t total_probe_points = TERN(AUTO_BED_LEVELING_3POINT, 3, GRID_MAX_POINTS);
#if ENABLED(AUTO_BED_LEVELING_3POINT)
3
#elif ABL_GRID || ENABLED(MESH_BED_LEVELING)
GRID_MAX_POINTS
#endif
);
// //
// Bed leveling is done. Wait for G29 to complete. // Bed leveling is done. Wait for G29 to complete.
@ -75,7 +69,7 @@
ui.synchronize(GET_TEXT(MSG_LEVEL_BED_DONE)); ui.synchronize(GET_TEXT(MSG_LEVEL_BED_DONE));
#endif #endif
ui.goto_previous_screen_no_defer(); 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)); if (ui.should_draw()) MenuItem_static::draw(LCD_HEIGHT >= 4, GET_TEXT(MSG_LEVEL_BED_DONE));
ui.refresh(LCDVIEW_CALL_REDRAW_NEXT); ui.refresh(LCDVIEW_CALL_REDRAW_NEXT);

View file

@ -44,7 +44,7 @@ static void lcd_cancel_object_confirm() {
MenuItem_confirm::confirm_screen( MenuItem_confirm::confirm_screen(
[]{ []{
cancelable.cancel_object(MenuItemBase::itemIndex - 1); cancelable.cancel_object(MenuItemBase::itemIndex - 1);
TERN_(HAS_BUZZER, ui.completion_feedback()); ui.completion_feedback();
ui.goto_previous_screen(); ui.goto_previous_screen();
}, },
ui.goto_previous_screen, ui.goto_previous_screen,

View file

@ -450,10 +450,7 @@ void menu_configuration() {
#endif #endif
if (!busy) if (!busy)
ACTION_ITEM(MSG_RESTORE_DEFAULTS, []{ ACTION_ITEM(MSG_RESTORE_DEFAULTS, []{ settings.reset(); ui.completion_feedback(); });
settings.reset();
TERN_(HAS_BUZZER, ui.completion_feedback());
});
END_MENU(); END_MENU();
} }

View file

@ -239,7 +239,7 @@ void menu_main() {
#if HAS_SERVICE_INTERVALS #if HAS_SERVICE_INTERVALS
static auto _service_reset = [](const int index) { static auto _service_reset = [](const int index) {
print_job_timer.resetServiceInterval(index); print_job_timer.resetServiceInterval(index);
TERN_(HAS_BUZZER, ui.completion_feedback()); ui.completion_feedback();
ui.reset_status(); ui.reset_status();
ui.return_to_status(); ui.return_to_status();
}; };

View file

@ -397,6 +397,8 @@ public:
static void quick_feedback(const bool clear_buttons=true); static void quick_feedback(const bool clear_buttons=true);
#if HAS_BUZZER #if HAS_BUZZER
static void completion_feedback(const bool good=true); static void completion_feedback(const bool good=true);
#else
static inline void completion_feedback(const bool=true) {}
#endif #endif
#if DISABLED(LIGHTWEIGHT_UI) #if DISABLED(LIGHTWEIGHT_UI)