Browse Source

Allow disable of LCD click

vanilla_fb_2.0.x
Scott Lahteine 5 years ago
parent
commit
3bf0d8d161
  1. 3
      Marlin/src/inc/Conditionals_post.h
  2. 15
      Marlin/src/lcd/ultralcd.cpp
  3. 12
      Marlin/src/lcd/ultralcd.h

3
Marlin/src/inc/Conditionals_post.h

@ -1882,6 +1882,9 @@
#endif
#if PIN_EXISTS(BEEPER) || EITHER(LCD_USE_I2C_BUZZER, PCA9632_BUZZER)
#define HAS_BUZZER 1
#if LCD_FEEDBACK_FREQUENCY_DURATION_MS && LCD_FEEDBACK_FREQUENCY_HZ
#define HAS_CHIRP 1
#endif
#endif
#if HAS_BUZZER && DISABLED(LCD_USE_I2C_BUZZER, PCA9632_BUZZER)
#define USE_BEEPER 1

15
Marlin/src/lcd/ultralcd.cpp

@ -612,15 +612,12 @@ void MarlinUI::quick_feedback(const bool clear_buttons/*=true*/) {
UNUSED(clear_buttons);
#endif
#if HAS_BUZZER
// Buzz and wait. Is the delay needed for buttons to settle?
buzz(LCD_FEEDBACK_FREQUENCY_DURATION_MS, LCD_FEEDBACK_FREQUENCY_HZ);
#if HAS_LCD_MENU
#if USE_BEEPER
for (int8_t i = 5; i--;) { buzzer.tick(); delay(2); }
#else
delay(10);
#endif
#if HAS_CHIRP
chirp(); // Buzz and wait. Is the delay needed for buttons to settle?
#if BOTH(HAS_LCD_MENU, USE_BEEPER)
for (int8_t i = 5; i--;) { buzzer.tick(); delay(2); }
#elif HAS_LCD_MENU
delay(10);
#endif
#endif
}

12
Marlin/src/lcd/ultralcd.h

@ -398,6 +398,12 @@ public:
static millis_t next_filament_display;
#endif
FORCE_INLINE static void chirp() {
#if HAS_CHIRP
buzz(LCD_FEEDBACK_FREQUENCY_DURATION_MS, LCD_FEEDBACK_FREQUENCY_HZ);
#endif
}
static void quick_feedback(const bool clear_buttons=true);
#if HAS_BUZZER
static void completion_feedback(const bool good=true);
@ -524,12 +530,6 @@ public:
static void reselect_last_file();
#endif
#if ENABLED(G26_MESH_VALIDATION)
FORCE_INLINE static void chirp() {
TERN_(HAS_BUZZER, buzz(LCD_FEEDBACK_FREQUENCY_DURATION_MS, LCD_FEEDBACK_FREQUENCY_HZ));
}
#endif
#if ENABLED(AUTO_BED_LEVELING_UBL)
static void ubl_plot(const uint8_t x_plot, const uint8_t y_plot);
#endif

Loading…
Cancel
Save