Browse Source

-disabled CARDDETECT if PIN is set to -1

- redo disable Beeper if PIN is set to -1
Christian Thalhammer 12 years ago
parent
commit
b51e8bf7e5
2 changed files with 14 additions and 4 deletions
  1. 5
    1
      Marlin/ultralcd.h
  2. 9
    3
      Marlin/ultralcd.pde

+ 5
- 1
Marlin/ultralcd.h View File

@@ -27,7 +27,11 @@
27 27
     
28 28
     #define CLICKED (buttons&EN_C)
29 29
     #define BLOCK {blocking=millis()+blocktime;}
30
-    #define CARDINSERTED (READ(SDCARDDETECT)==0)
30
+    #if (SDCARDDETECT > -1)
31
+    {
32
+      #define CARDINSERTED (READ(SDCARDDETECT)==0)
33
+    }
34
+    #endif
31 35
     
32 36
   #else
33 37
 

+ 9
- 3
Marlin/ultralcd.pde View File

@@ -130,7 +130,7 @@ void beep()
130 130
 {
131 131
   //return;
132 132
   #ifdef ULTIPANEL
133
-	if (BEEPER > -1)
133
+	#if (BEEPER > -1)
134 134
 	{
135 135
 		pinMode(BEEPER,OUTPUT);
136 136
 		for(int8_t i=0;i<20;i++){
@@ -140,6 +140,7 @@ void beep()
140 140
 		delay(5);
141 141
 		}
142 142
 	}
143
+        #endif
143 144
   #endif
144 145
 }
145 146
 
@@ -147,7 +148,7 @@ void beepshort()
147 148
 {
148 149
   //return;
149 150
   #ifdef ULTIPANEL
150
-	if (BEEPER > -1)
151
+	#if (BEEPER > -1)
151 152
 	{
152 153
 		pinMode(BEEPER,OUTPUT);
153 154
 		for(int8_t i=0;i<10;i++){
@@ -157,6 +158,7 @@ void beepshort()
157 158
 		delay(3);
158 159
 		}
159 160
 	}
161
+        #endif
160 162
   #endif  
161 163
 }
162 164
 
@@ -203,7 +205,11 @@ void buttons_init()
203 205
     WRITE(BTN_EN1,HIGH);
204 206
     WRITE(BTN_EN2,HIGH);
205 207
     WRITE(BTN_ENC,HIGH);
206
-    WRITE(SDCARDDETECT,HIGH);
208
+    #if (SDCARDDETECT > -1)
209
+    {
210
+      WRITE(SDCARDDETECT,HIGH);
211
+    }
212
+    #endif
207 213
   #else
208 214
     pinMode(SHIFT_CLK,OUTPUT);
209 215
     pinMode(SHIFT_LD,OUTPUT);

Loading…
Cancel
Save