Browse Source

Add empty ui.completion_feedback

Scott Lahteine 4 years ago
parent
commit
69f211cf78

+ 2
- 2
Marlin/src/lcd/menu/menu.cpp View File

@@ -413,12 +413,12 @@ void scroll_screen(const uint8_t limit, const bool is_menu) {
413 413
 #if ENABLED(EEPROM_SETTINGS)
414 414
   void lcd_store_settings() {
415 415
     const bool saved = settings.save();
416
-    TERN_(HAS_BUZZER, ui.completion_feedback(saved));
416
+    ui.completion_feedback(saved);
417 417
     UNUSED(saved);
418 418
   }
419 419
   void lcd_load_settings() {
420 420
     const bool loaded = settings.load();
421
-    TERN_(HAS_BUZZER, ui.completion_feedback(loaded));
421
+    ui.completion_feedback(loaded);
422 422
     UNUSED(loaded);
423 423
   }
424 424
 #endif

+ 1
- 1
Marlin/src/lcd/menu/menu_advanced.cpp View File

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

+ 2
- 8
Marlin/src/lcd/menu/menu_bed_leveling.cpp View File

@@ -48,13 +48,7 @@
48 48
   static uint8_t manual_probe_index;
49 49
 
50 50
   // LCD probed points are from defaults
51
-  constexpr uint8_t total_probe_points = (
52
-    #if ENABLED(AUTO_BED_LEVELING_3POINT)
53
-      3
54
-    #elif ABL_GRID || ENABLED(MESH_BED_LEVELING)
55
-      GRID_MAX_POINTS
56
-    #endif
57
-  );
51
+  constexpr uint8_t total_probe_points = TERN(AUTO_BED_LEVELING_3POINT, 3, GRID_MAX_POINTS);
58 52
 
59 53
   //
60 54
   // Bed leveling is done. Wait for G29 to complete.
@@ -75,7 +69,7 @@
75 69
         ui.synchronize(GET_TEXT(MSG_LEVEL_BED_DONE));
76 70
       #endif
77 71
       ui.goto_previous_screen_no_defer();
78
-      TERN_(HAS_BUZZER, ui.completion_feedback());
72
+      ui.completion_feedback();
79 73
     }
80 74
     if (ui.should_draw()) MenuItem_static::draw(LCD_HEIGHT >= 4, GET_TEXT(MSG_LEVEL_BED_DONE));
81 75
     ui.refresh(LCDVIEW_CALL_REDRAW_NEXT);

+ 1
- 1
Marlin/src/lcd/menu/menu_cancelobject.cpp View File

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

+ 1
- 4
Marlin/src/lcd/menu/menu_configuration.cpp View File

@@ -450,10 +450,7 @@ void menu_configuration() {
450 450
   #endif
451 451
 
452 452
   if (!busy)
453
-    ACTION_ITEM(MSG_RESTORE_DEFAULTS, []{
454
-      settings.reset();
455
-      TERN_(HAS_BUZZER, ui.completion_feedback());
456
-    });
453
+    ACTION_ITEM(MSG_RESTORE_DEFAULTS, []{ settings.reset(); ui.completion_feedback(); });
457 454
 
458 455
   END_MENU();
459 456
 }

+ 1
- 1
Marlin/src/lcd/menu/menu_main.cpp View File

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

+ 2
- 0
Marlin/src/lcd/ultralcd.h View File

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

Loading…
Cancel
Save