chiark / gitweb /
Fixed general 16x2 LCD build without SD support.
authorDaid <daid303@gmail.com>
Wed, 29 Feb 2012 14:33:23 +0000 (15:33 +0100)
committerDaid <daid303@gmail.com>
Wed, 29 Feb 2012 14:33:23 +0000 (15:33 +0100)
Marlin/cardreader.h
Marlin/ultralcd.h
Marlin/ultralcd.pde

index 67fe58a90a69cc17b340d67becda040e61ac51e2..55fa786d7b08aa8d42351e7d9bd368546e7aa50b 100644 (file)
@@ -64,39 +64,11 @@ private:
   char* diveDirName;
   void lsDive(const char *prepend,SdFile parent);
 };
-  
+#define IS_SD_PRINTING (card.sdprinting)
 
 #else
 
-#define dir_t bool 
-class CardReader
-{
-public:
-  FORCE_INLINE CardReader(){};
-  
-  FORCE_INLINE static void initsd(){};
-  FORCE_INLINE static void write_command(char *buf){};
-  
-  FORCE_INLINE static void checkautostart(bool x) {}; 
-  
-  FORCE_INLINE static void openFile(char* name,bool read){};
-  FORCE_INLINE static void closefile() {};
-  FORCE_INLINE static void release(){};
-  FORCE_INLINE static void startFileprint(){};
-  FORCE_INLINE static void startFilewrite(char *name){};
-  FORCE_INLINE static void pauseSDPrint(){};
-  FORCE_INLINE static void getStatus(){};
-  
-  FORCE_INLINE static void selectFile(char* name){};
-  FORCE_INLINE static void getfilename(const uint8_t nr){};
-  FORCE_INLINE static uint8_t getnrfilenames(){return 0;};
-  
+#define IS_SD_PRINTING (false)
 
-  FORCE_INLINE static void ls() {};
-  FORCE_INLINE static bool eof() {return true;};
-  FORCE_INLINE static char get() {return 0;};
-  FORCE_INLINE static void setIndex(){};
-  FORCE_INLINE uint8_t percentDone(){return 0;};
-};
 #endif //SDSUPPORT
-#endif
\ No newline at end of file
+#endif
index c4392d26fc3e0d4317a0e533d8beef490ccfcc92..253149cbba5804424d703e0fa46fa7b6833933de 100644 (file)
 
   //conversion routines, could need some overworking
   char *ftostr51(const float &x);
+  char *ftostr52(const float &x);
   char *ftostr31(const float &x);
   char *ftostr3(const float &x);
 
   #define LCD_MESSAGE(x)
   #define LCD_MESSAGEPGM(x)
   FORCE_INLINE void lcd_status() {};
-#endif
-  
-#ifndef ULTIPANEL  
- #define CLICKED false
+
+  #define CLICKED false
   #define BLOCK ;
 #endif 
   
@@ -160,4 +159,3 @@ char *itostr3(const int &xx);
 char *itostr4(const int &xx);
 char *ftostr51(const float &x);
 #endif //ULTRALCD
-
index 54b701284822537e5e926e76bf59b8eca3c0473c..8a059a1b7fffe9952d4622d6202a2a573aaffe40 100644 (file)
@@ -12,7 +12,9 @@ extern volatile bool feedmultiplychanged;
 extern volatile int extrudemultiply;
 
 extern long position[4];   
+#ifdef SDSUPPORT
 extern CardReader card;
+#endif
 
 //===========================================================================
 //=============================public variables============================
@@ -480,7 +482,11 @@ void MainMenu::showPrepare()
       MENUITEM(  lcdprintPGM(MSG_MAIN)  ,  BLOCK;status=Main_Menu;beepshort(); ) ;
       break;
     case ItemP_autostart:
-      MENUITEM(  lcdprintPGM(MSG_AUTOSTART)  ,  BLOCK;card.lastnr=0;card.setroot();card.checkautostart(true);beepshort(); ) ;
+      MENUITEM(  lcdprintPGM(MSG_AUTOSTART)  ,  BLOCK;
+#ifdef SDSUPPORT
+          card.lastnr=0;card.setroot();card.checkautostart(true);
+#endif
+          beepshort(); ) ;
       break;
     case ItemP_disstep:
       MENUITEM(  lcdprintPGM(MSG_DISABLE_STEPPERS)  ,  BLOCK;enquecommand("M84");beepshort(); ) ;
@@ -1629,7 +1635,7 @@ void MainMenu::showControlMotion()
         if(linechanging)
         {
           if(encoderpos<5) encoderpos=5;
-          if(encoderpos>99999) encoderpos=99999;
+          if(encoderpos>32000) encoderpos=32000;//TODO: This is a problem, encoderpos is 16bit, but steps_per_unit for e can be wel over 800
           lcd.setCursor(11,line);lcd.print(ftostr52(encoderpos/100.0));
         }
         
@@ -1957,7 +1963,7 @@ void MainMenu::showMainMenu()
   #endif
   if(tune)
   {
-    if(!(movesplanned() ||card.sdprinting))
+    if(!(movesplanned() || IS_SD_PRINTING))
     {
       force_lcd_update=true;
       tune=false;
@@ -1965,7 +1971,7 @@ void MainMenu::showMainMenu()
   }
   else 
   {
-    if(movesplanned() ||card.sdprinting)
+    if(movesplanned() || IS_SD_PRINTING)
     {
       force_lcd_update=true;
       tune=true;