From 9c5d14ea683099cbc70597894488281ab380c4f1 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 25 Apr 2015 03:12:49 -0700 Subject: [PATCH 1/2] Fix BEEPER duration --- Marlin/ultralcd.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 1d4e167287..433d0087b1 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -1544,7 +1544,9 @@ void lcd_buzz(long duration, uint16_t freq) { if (freq > 0) { #if BEEPER > 0 SET_OUTPUT(BEEPER); - tone(BEEPER, freq, duration); + tone(BEEPER, freq); + delay(duration); + noTone(BEEPER); #elif defined(LCD_USE_I2C_BUZZER) lcd.buzz(duration,freq); #else From a932e7490fcfa01eb64c3675a0ce83d29c16045c Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 25 Apr 2015 03:25:30 -0700 Subject: [PATCH 2/2] No noTone needed, but delay is --- Marlin/ultralcd.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 433d0087b1..d2fb575ce0 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -1544,11 +1544,10 @@ void lcd_buzz(long duration, uint16_t freq) { if (freq > 0) { #if BEEPER > 0 SET_OUTPUT(BEEPER); - tone(BEEPER, freq); + tone(BEEPER, freq, duration); delay(duration); - noTone(BEEPER); #elif defined(LCD_USE_I2C_BUZZER) - lcd.buzz(duration,freq); + lcd.buzz(duration, freq); #else delay(duration); #endif