Browse Source

-disalbe beeper if BEEPER_PIN = -1

Christian Thalhammer 12 years ago
parent
commit
5edef148fe
1 changed files with 20 additions and 14 deletions
  1. 20
    14
      Marlin/ultralcd.pde

+ 20
- 14
Marlin/ultralcd.pde View File

@@ -130,13 +130,16 @@ void beep()
130 130
 {
131 131
   //return;
132 132
   #ifdef ULTIPANEL
133
-    pinMode(BEEPER,OUTPUT);
134
-    for(int8_t i=0;i<20;i++){
135
-      WRITE(BEEPER,HIGH);
136
-      delay(5);
137
-      WRITE(BEEPER,LOW);
138
-      delay(5);
139
-    }
133
+	if (BEEPER > -1)
134
+	{
135
+		pinMode(BEEPER,OUTPUT);
136
+		for(int8_t i=0;i<20;i++){
137
+		WRITE(BEEPER,HIGH);
138
+		delay(5);
139
+		WRITE(BEEPER,LOW);
140
+		delay(5);
141
+		}
142
+	}
140 143
   #endif
141 144
 }
142 145
 
@@ -144,13 +147,16 @@ void beepshort()
144 147
 {
145 148
   //return;
146 149
   #ifdef ULTIPANEL
147
-    pinMode(BEEPER,OUTPUT);
148
-    for(int8_t i=0;i<10;i++){
149
-      WRITE(BEEPER,HIGH);
150
-      delay(3);
151
-      WRITE(BEEPER,LOW);
152
-      delay(3);
153
-    }
150
+	if (BEEPER > -1)
151
+	{
152
+		pinMode(BEEPER,OUTPUT);
153
+		for(int8_t i=0;i<10;i++){
154
+		WRITE(BEEPER,HIGH);
155
+		delay(3);
156
+		WRITE(BEEPER,LOW);
157
+		delay(3);
158
+		}
159
+	}
154 160
   #endif  
155 161
 }
156 162
 

Loading…
Cancel
Save