chiark / gitweb /
This is in my opinion a much better way of dealing with SD cards than my previous...
authorBlair Thompson <mail@justblair.co.uk>
Sat, 3 Mar 2012 16:30:31 +0000 (16:30 +0000)
committerBlair Thompson <mail@justblair.co.uk>
Sat, 3 Mar 2012 16:30:31 +0000 (16:30 +0000)
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
Marlin/ultralcd.pde

index fb809ce5838a32e0997e74983de0b79458e6443e..b9b96c2d0df352c4218e0ea9666f3740db9fd07b 100644 (file)
 #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
     #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
index 54b701284822537e5e926e76bf59b8eca3c0473c..fa1a5566c9055bf98dba9e61aef91a23b04767ec 100644 (file)
@@ -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: