Browse Source

Added a workaround. Ramps SD card does not have sdcarddetect. My temporary solution is to add a momentary swtich

that pulls down the SDCARDDETECT pin and mimicking the pull and reinsert ofa a SD card
Blair Thompson 13 years ago
parent
commit
a05a261b72
3 changed files with 20 additions and 6 deletions
  1. 7
    0
      Marlin/Configuration.h
  2. 4
    4
      Marlin/pins.h
  3. 9
    2
      Marlin/ultralcd.h

+ 7
- 0
Marlin/Configuration.h View File

@@ -179,6 +179,13 @@ const bool Z_ENDSTOPS_INVERTING = false; // set to true to invert the logic of t
179 179
 //#define ULTRA_LCD  //general lcd support, also 16x2
180 180
 #define SDSUPPORT // Enable SD Card Support in Hardware Console
181 181
 
182
+// Invert the SD card Detect Pin.  
183
+// If you are using a RAMPS board or cheap E-bay purchased boards that do not detect when an SD card is inserted
184
+// You can get round this by connecting a push button or single throw switch to the pin defined as SDCARDCARDDETECT 
185
+// in the pins.h file.  When using a push button pulling the pin to ground this will need inverted.  This setting should
186
+// be commented out otherwise
187
+#define SDCARDDETECTINVERTED 
188
+
182 189
 #define ULTIPANEL
183 190
 #ifdef ULTIPANEL
184 191
   #define NEWPANEL  //enable this if you have a click-encoder panel

+ 4
- 4
Marlin/pins.h View File

@@ -281,8 +281,8 @@
281 281
 #ifdef ULTRA_LCD
282 282
 
283 283
   #ifdef NEWPANEL
284
-  //arduino pin witch triggers an piezzo beeper
285
-    #define BEEPER -1			// No Beeper added
284
+  //arduino pin which triggers an piezzo beeper
285
+    #define BEEPER 33			// Beeper on AUX-4
286 286
 
287 287
     #define LCD_PINS_RS 16 
288 288
     #define LCD_PINS_ENABLE 17
@@ -300,7 +300,7 @@
300 300
     #define BLEN_B 1
301 301
     #define BLEN_A 0
302 302
     
303
-    #define SDCARDDETECT -1		// Ramps does not use this port
303
+    #define SDCARDDETECT 31		// Ramps does not use this port
304 304
     
305 305
       //encoder rotation values
306 306
     #define encrot0 0
@@ -310,7 +310,7 @@
310 310
 
311 311
   #else //old style panel with shift register
312 312
     //arduino pin witch triggers an piezzo beeper
313
-    #define BEEPER -1		No Beeper added
313
+    #define BEEPER 33		No Beeper added
314 314
 
315 315
     //buttons are attached to a shift register
316 316
 	// Not wired this yet

+ 9
- 2
Marlin/ultralcd.h View File

@@ -27,8 +27,15 @@
27 27
     
28 28
     #define CLICKED (buttons&EN_C)
29 29
     #define BLOCK {blocking=millis()+blocktime;}
30
-    #define CARDINSERTED (READ(SDCARDDETECT)==0)
31
-    
30
+
31
+	#ifdef SDCARDDETECTINVERTED 
32
+		#define CARDINSERTED (READ(SDCARDDETECT)!=0)
33
+
34
+	#else
35
+		#define CARDINSERTED (READ(SDCARDDETECT)==0)
36
+
37
+	#endif  //SDCARDTETECTINVERTED
38
+
32 39
   #else
33 40
 
34 41
     //atomatic, do not change

Loading…
Cancel
Save