Rework buzzing (PR#2296)

by:
Moving HAS_LCD_BUZZ macro to Coditionals.h
Renaming HAS_LCD_BUZZ to HAS_BUZZER to make clear is has nothing to do with the lcd.
Removing the ULTRALCD condition.

Moving declaration of lcd_buzz() out of the ULTRA_LCD block in ultralcd.h
Moving definition of lcd_buzz() out of the ULTIPANEL block in ultralcd.cpp
Renaming lcd_buzz() to buzz() to make clear is has nothing to do with the lcd.

All buzzing code is now only dependent on the existence of a BEEPER-pin or the definition of a LCD_USE_I2C_BUZZER.

To do: Check the conditions for the BEEPER-pin in all pin-files.
This commit is contained in:
AnHardt
2015-06-15 00:12:02 +02:00
committed by Richard Wackerbarth
parent 29122db2fa
commit 6ab7b560af
4 changed files with 22 additions and 18 deletions

View File

@ -52,8 +52,6 @@
#ifdef FILAMENT_LCD_DISPLAY
extern millis_t previous_lcd_status_ms;
#endif
void lcd_buzz(long duration,uint16_t freq);
void lcd_quick_feedback(); // Audible feedback for a button click - could also be visual
bool lcd_clicked();
@ -106,7 +104,6 @@
FORCE_INLINE void lcd_setstatuspgm(const char* message, const uint8_t level=0) {}
FORCE_INLINE void lcd_buttons_update() {}
FORCE_INLINE void lcd_reset_alert_level() {}
FORCE_INLINE void lcd_buzz(long duration, uint16_t freq) {}
FORCE_INLINE bool lcd_detected(void) { return true; }
#define LCD_MESSAGEPGM(x) do{}while(0)
@ -114,6 +111,10 @@
#endif //ULTRA_LCD
#if HAS_BUZZER
void buzz(long duration,uint16_t freq);
#endif
char *itostr2(const uint8_t &x);
char *itostr31(const int &xx);
char *itostr3(const int &xx);