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
This commit is contained in:
Blair Thompson 2012-02-18 23:56:31 +00:00
parent 1b6765ed12
commit a05a261b72
3 changed files with 20 additions and 6 deletions

View 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

View File

@ -281,8 +281,8 @@
#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
@ -300,7 +300,7 @@
#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
@ -310,7 +310,7 @@
#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

View File

@ -27,8 +27,15 @@
#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