chiark / gitweb /
Added a workaround. Ramps SD card does not have sdcarddetect. My temporary solution...
authorBlair Thompson <mail@justblair.co.uk>
Sat, 18 Feb 2012 23:56:31 +0000 (23:56 +0000)
committerBlair Thompson <mail@justblair.co.uk>
Sat, 18 Feb 2012 23:56:31 +0000 (23:56 +0000)
that pulls down the SDCARDDETECT pin and mimicking the pull and reinsert ofa a SD card

Marlin/Configuration.h
Marlin/pins.h
Marlin/ultralcd.h

index fa12c0082ef59794df5f84d9ae8409cb30412ca9..4497ec7cdbd7da98844603bc541d9f025532b5a2 100644 (file)
@@ -179,6 +179,13 @@ const bool Z_ENDSTOPS_INVERTING = false; // set to true to invert the logic of t
 //#define ULTRA_LCD  //general lcd support, also 16x2
 #define SDSUPPORT // Enable SD Card Support in Hardware Console
 
+// Invert the SD card Detect Pin.  
+// If you are using a RAMPS board or cheap E-bay purchased boards that do not detect when an SD card is inserted
+// You can get round this by connecting a push button or single throw switch to the pin defined as SDCARDCARDDETECT 
+// in the pins.h file.  When using a push button pulling the pin to ground this will need inverted.  This setting should
+// be commented out otherwise
+#define SDCARDDETECTINVERTED 
+
 #define ULTIPANEL
 #ifdef ULTIPANEL
   #define NEWPANEL  //enable this if you have a click-encoder panel
index a366a679a58d6f97b45cf5cb15ddebec558d6d0c..ec6eef66b51b46a37465ba2f82b7a732265f36d5 100644 (file)
 #ifdef ULTRA_LCD
 
   #ifdef NEWPANEL
-  //arduino pin witch triggers an piezzo beeper
-    #define BEEPER -1                  // No Beeper added
+  //arduino pin which triggers an piezzo beeper
+    #define BEEPER 33                  // Beeper on AUX-4
 
     #define LCD_PINS_RS 16 
     #define LCD_PINS_ENABLE 17
     #define BLEN_B 1
     #define BLEN_A 0
     
-    #define SDCARDDETECT -1            // Ramps does not use this port
+    #define SDCARDDETECT 31            // Ramps does not use this port
     
       //encoder rotation values
     #define encrot0 0
 
   #else //old style panel with shift register
     //arduino pin witch triggers an piezzo beeper
-    #define BEEPER -1          No Beeper added
+    #define BEEPER 33          No Beeper added
 
     //buttons are attached to a shift register
        // Not wired this yet
index 08ac950d38e1fc68a81470032126fd0e7b43a947..25abb427c0a16d16f827b1cbe3cb429bf1f3a19e 100644 (file)
     
     #define CLICKED (buttons&EN_C)
     #define BLOCK {blocking=millis()+blocktime;}
-    #define CARDINSERTED (READ(SDCARDDETECT)==0)
-    
+
+       #ifdef SDCARDDETECTINVERTED 
+               #define CARDINSERTED (READ(SDCARDDETECT)!=0)
+
+       #else
+               #define CARDINSERTED (READ(SDCARDDETECT)==0)
+
+       #endif  //SDCARDTETECTINVERTED
+
   #else
 
     //atomatic, do not change