Browse Source

Add configurable beep for UltiPanel.

pull/1/head
daid 11 years ago
parent
commit
46f5bea19f
  1. 12
      Marlin/ultralcd_implementation_hitachi_HD44780.h

12
Marlin/ultralcd_implementation_hitachi_HD44780.h

@ -718,13 +718,23 @@ static void lcd_implementation_quick_feedback()
#endif #endif
#elif defined(BEEPER) && BEEPER > -1 #elif defined(BEEPER) && BEEPER > -1
SET_OUTPUT(BEEPER); SET_OUTPUT(BEEPER);
#if !defined(LCD_FEEDBACK_FREQUENCY_HZ) || !defined(LCD_FEEDBACK_FREQUENCY_DURATION_MS)
for(int8_t i=0;i<10;i++) for(int8_t i=0;i<10;i++)
{ {
WRITE(BEEPER,HIGH); WRITE(BEEPER,HIGH);
delayMicroseconds(100); delayMicroseconds(100);
WRITE(BEEPER,LOW); WRITE(BEEPER,LOW);
delayMicroseconds(100); 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 #endif
} }

Loading…
Cancel
Save