Browse Source

Add configurable beep for UltiPanel.

daid 11 years ago
parent
commit
46f5bea19f
1 changed files with 11 additions and 1 deletions
  1. 11
    1
      Marlin/ultralcd_implementation_hitachi_HD44780.h

+ 11
- 1
Marlin/ultralcd_implementation_hitachi_HD44780.h View File

718
 	#endif
718
 	#endif
719
 #elif defined(BEEPER) && BEEPER > -1
719
 #elif defined(BEEPER) && BEEPER > -1
720
     SET_OUTPUT(BEEPER);
720
     SET_OUTPUT(BEEPER);
721
+	#if !defined(LCD_FEEDBACK_FREQUENCY_HZ) || !defined(LCD_FEEDBACK_FREQUENCY_DURATION_MS)
721
     for(int8_t i=0;i<10;i++)
722
     for(int8_t i=0;i<10;i++)
722
     {
723
     {
723
       WRITE(BEEPER,HIGH);
724
       WRITE(BEEPER,HIGH);
724
       delayMicroseconds(100);
725
       delayMicroseconds(100);
725
       WRITE(BEEPER,LOW);
726
       WRITE(BEEPER,LOW);
726
       delayMicroseconds(100);
727
       delayMicroseconds(100);
727
-    }
728
+    }
729
+    #else
730
+    for(int8_t i=0;i<(LCD_FEEDBACK_FREQUENCY_DURATION_MS / (1000 / LCD_FEEDBACK_FREQUENCY_HZ));i++)
731
+    {
732
+      WRITE(BEEPER,HIGH);
733
+      delayMicroseconds(1000000 / LCD_FEEDBACK_FREQUENCY_HZ / 2);
734
+      WRITE(BEEPER,LOW);
735
+      delayMicroseconds(1000000 / LCD_FEEDBACK_FREQUENCY_HZ / 2);
736
+    }
737
+    #endif
728
 #endif
738
 #endif
729
 }
739
 }
730
 
740
 

Loading…
Cancel
Save