From f278e1c00f3070130b6cc0d740803414eae01d56 Mon Sep 17 00:00:00 2001 From: Blair Thompson Date: Sat, 3 Mar 2012 16:30:31 +0000 Subject: [PATCH] This is in my opinion a much better way of dealing with SD cards than my previous fix. Instead of adding a momentary switch to fake the insertion of the card I have modified the ultralcd menu item: Card Menu -> Refresh to reinitialise the card providing that the SDCARDDETECT pin has been set to -1 in the pins.h file. This requires one less switch on the front panel and the refresh menu item is in the most relevent place for a user who wishes to inert a card and then print from it. It also means that the "Card inserted" messages do not bother the users of these card readers (they dont make sense for users without SCCARDDETECT) --- Marlin/pins.h | 4 ++-- Marlin/ultralcd.pde | 18 +++++++++++++++--- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/Marlin/pins.h b/Marlin/pins.h index fb809ce58..b9b96c2d0 100644 --- a/Marlin/pins.h +++ b/Marlin/pins.h @@ -285,7 +285,7 @@ #define FAN_PIN 4 // IO pin. Buffer needed #endif #define PS_ON_PIN 12 -#define KILL_PIN -1 +#define KILL_PIN 31 #define HEATER_0_PIN 10 // EXTRUDER 1 #if MOTHERBOARD == 33 @@ -322,7 +322,7 @@ #define BLEN_B 1 #define BLEN_A 0 - #define SDCARDDETECT 31 // Ramps does not use this port + #define SDCARDDETECT -1 // Ramps does not use this port //encoder rotation values #define encrot0 0 diff --git a/Marlin/ultralcd.pde b/Marlin/ultralcd.pde index 54b701284..fa1a5566c 100644 --- a/Marlin/ultralcd.pde +++ b/Marlin/ultralcd.pde @@ -529,7 +529,7 @@ void MainMenu::showAxisMove() switch(i) { case ItemAM_exit: - MENUITEM( lcdprintPGM(" Prepare \003") , BLOCK;status=Main_Menu;beepshort(); ) ; + MENUITEM( lcdprintPGM(MSG_PREPARE_ALT) , BLOCK;status=Main_Menu;beepshort(); ) ; break; case ItemAM_X: { @@ -805,7 +805,7 @@ void MainMenu::showTune() { if(force_lcd_update) { - lcd.setCursor(0,line);lcdprintPGM(" Fan speed:"); + lcd.setCursor(0,line);lcdprintPGM(MSG_FAN_SPEED); lcd.setCursor(13,line);lcd.print(ftostr3(fanpwm)); } @@ -1890,7 +1890,19 @@ void MainMenu::showSD() // } // }break; case 1: - MENUITEM( lcd.print(" ");card.getWorkDirName();if(card.filename[0]=='/') lcdprintPGM(MSG_REFRESH);else {lcd.print("\005");lcd.print(card.filename);lcd.print("/..");} , BLOCK;card.updir();enforceupdate=true;lineoffset=0;beepshort(); ) ; + MENUITEM( lcd.print(" ");card.getWorkDirName(); + if(card.filename[0]=='/') lcdprintPGM(MSG_REFRESH); + else { + lcd.print("\005"); + lcd.print(card.filename); + lcd.print("/.."); + } , + BLOCK; + if(SDCARDDETECT == -1) card.initsd(); + card.updir(); + enforceupdate=true; + lineoffset=0; + beepshort(); ) ; break; default: