chiark / gitweb /
-disalbe beeper if BEEPER_PIN = -1
authorChristian Thalhammer <christian_thalhammer@gmx.at>
Mon, 6 Feb 2012 11:10:32 +0000 (12:10 +0100)
committerChristian Thalhammer <christian_thalhammer@gmx.at>
Mon, 6 Feb 2012 11:10:32 +0000 (12:10 +0100)
Marlin/ultralcd.pde

index 69be85959a992f41ae1c0ad8ee8a3c59d9162ff1..720567f2ee30cd358646a3a02bf1fdeab5b07075 100644 (file)
@@ -130,13 +130,16 @@ void beep()
 {
   //return;
   #ifdef ULTIPANEL
-    pinMode(BEEPER,OUTPUT);
-    for(int8_t i=0;i<20;i++){
-      WRITE(BEEPER,HIGH);
-      delay(5);
-      WRITE(BEEPER,LOW);
-      delay(5);
-    }
+       if (BEEPER > -1)
+       {
+               pinMode(BEEPER,OUTPUT);
+               for(int8_t i=0;i<20;i++){
+               WRITE(BEEPER,HIGH);
+               delay(5);
+               WRITE(BEEPER,LOW);
+               delay(5);
+               }
+       }
   #endif
 }
 
@@ -144,13 +147,16 @@ void beepshort()
 {
   //return;
   #ifdef ULTIPANEL
-    pinMode(BEEPER,OUTPUT);
-    for(int8_t i=0;i<10;i++){
-      WRITE(BEEPER,HIGH);
-      delay(3);
-      WRITE(BEEPER,LOW);
-      delay(3);
-    }
+       if (BEEPER > -1)
+       {
+               pinMode(BEEPER,OUTPUT);
+               for(int8_t i=0;i<10;i++){
+               WRITE(BEEPER,HIGH);
+               delay(3);
+               WRITE(BEEPER,LOW);
+               delay(3);
+               }
+       }
   #endif  
 }