Add configurable beep for UltiPanel.

This commit is contained in:
daid 2014-02-13 11:17:33 +01:00
parent d16a770855
commit 46f5bea19f

View file

@ -718,6 +718,7 @@ static void lcd_implementation_quick_feedback()
#endif
#elif defined(BEEPER) && BEEPER > -1
SET_OUTPUT(BEEPER);
#if !defined(LCD_FEEDBACK_FREQUENCY_HZ) || !defined(LCD_FEEDBACK_FREQUENCY_DURATION_MS)
for(int8_t i=0;i<10;i++)
{
WRITE(BEEPER,HIGH);
@ -725,6 +726,15 @@ static void lcd_implementation_quick_feedback()
WRITE(BEEPER,LOW);
delayMicroseconds(100);
}
#else
for(int8_t i=0;i<(LCD_FEEDBACK_FREQUENCY_DURATION_MS / (1000 / LCD_FEEDBACK_FREQUENCY_HZ));i++)
{
WRITE(BEEPER,HIGH);
delayMicroseconds(1000000 / LCD_FEEDBACK_FREQUENCY_HZ / 2);
WRITE(BEEPER,LOW);
delayMicroseconds(1000000 / LCD_FEEDBACK_FREQUENCY_HZ / 2);
}
#endif
#endif
}