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. 11
      Marlin/src/lcd/ultralcd.cpp
  3. 12
      Marlin/src/lcd/ultralcd.h

3
Marlin/src/inc/Conditionals_post.h

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

11
Marlin/src/lcd/ultralcd.cpp

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

12
Marlin/src/lcd/ultralcd.h

@ -398,6 +398,12 @@ public:
static millis_t next_filament_display; static millis_t next_filament_display;
#endif #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); 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);
@ -524,12 +530,6 @@ public:
static void reselect_last_file(); static void reselect_last_file();
#endif #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) #if ENABLED(AUTO_BED_LEVELING_UBL)
static void ubl_plot(const uint8_t x_plot, const uint8_t y_plot); static void ubl_plot(const uint8_t x_plot, const uint8_t y_plot);
#endif #endif

Loading…
Cancel
Save