Browse Source

Fixed general 16x2 LCD build without SD support.

Daid 13 years ago
parent
commit
3d83109028
3 changed files with 16 additions and 40 deletions
  1. 3
    31
      Marlin/cardreader.h
  2. 3
    5
      Marlin/ultralcd.h
  3. 10
    4
      Marlin/ultralcd.pde

+ 3
- 31
Marlin/cardreader.h View File

@@ -64,39 +64,11 @@ private:
64 64
   char* diveDirName;
65 65
   void lsDive(const char *prepend,SdFile parent);
66 66
 };
67
-  
67
+#define IS_SD_PRINTING (card.sdprinting)
68 68
 
69 69
 #else
70 70
 
71
-#define dir_t bool 
72
-class CardReader
73
-{
74
-public:
75
-  FORCE_INLINE CardReader(){};
76
-  
77
-  FORCE_INLINE static void initsd(){};
78
-  FORCE_INLINE static void write_command(char *buf){};
79
-  
80
-  FORCE_INLINE static void checkautostart(bool x) {}; 
81
-  
82
-  FORCE_INLINE static void openFile(char* name,bool read){};
83
-  FORCE_INLINE static void closefile() {};
84
-  FORCE_INLINE static void release(){};
85
-  FORCE_INLINE static void startFileprint(){};
86
-  FORCE_INLINE static void startFilewrite(char *name){};
87
-  FORCE_INLINE static void pauseSDPrint(){};
88
-  FORCE_INLINE static void getStatus(){};
89
-  
90
-  FORCE_INLINE static void selectFile(char* name){};
91
-  FORCE_INLINE static void getfilename(const uint8_t nr){};
92
-  FORCE_INLINE static uint8_t getnrfilenames(){return 0;};
93
-  
71
+#define IS_SD_PRINTING (false)
94 72
 
95
-  FORCE_INLINE static void ls() {};
96
-  FORCE_INLINE static bool eof() {return true;};
97
-  FORCE_INLINE static char get() {return 0;};
98
-  FORCE_INLINE static void setIndex(){};
99
-  FORCE_INLINE uint8_t percentDone(){return 0;};
100
-};
101 73
 #endif //SDSUPPORT
102
-#endif
74
+#endif

+ 3
- 5
Marlin/ultralcd.h View File

@@ -129,6 +129,7 @@
129 129
 
130 130
   //conversion routines, could need some overworking
131 131
   char *ftostr51(const float &x);
132
+  char *ftostr52(const float &x);
132 133
   char *ftostr31(const float &x);
133 134
   char *ftostr3(const float &x);
134 135
 
@@ -142,10 +143,8 @@
142 143
   #define LCD_MESSAGE(x)
143 144
   #define LCD_MESSAGEPGM(x)
144 145
   FORCE_INLINE void lcd_status() {};
145
-#endif
146
-  
147
-#ifndef ULTIPANEL  
148
- #define CLICKED false
146
+
147
+  #define CLICKED false
149 148
   #define BLOCK ;
150 149
 #endif 
151 150
   
@@ -160,4 +159,3 @@ char *itostr3(const int &xx);
160 159
 char *itostr4(const int &xx);
161 160
 char *ftostr51(const float &x);
162 161
 #endif //ULTRALCD
163
-

+ 10
- 4
Marlin/ultralcd.pde View File

@@ -12,7 +12,9 @@ extern volatile bool feedmultiplychanged;
12 12
 extern volatile int extrudemultiply;
13 13
 
14 14
 extern long position[4];   
15
+#ifdef SDSUPPORT
15 16
 extern CardReader card;
17
+#endif
16 18
 
17 19
 //===========================================================================
18 20
 //=============================public variables============================
@@ -480,7 +482,11 @@ void MainMenu::showPrepare()
480 482
       MENUITEM(  lcdprintPGM(MSG_MAIN)  ,  BLOCK;status=Main_Menu;beepshort(); ) ;
481 483
       break;
482 484
     case ItemP_autostart:
483
-      MENUITEM(  lcdprintPGM(MSG_AUTOSTART)  ,  BLOCK;card.lastnr=0;card.setroot();card.checkautostart(true);beepshort(); ) ;
485
+      MENUITEM(  lcdprintPGM(MSG_AUTOSTART)  ,  BLOCK;
486
+#ifdef SDSUPPORT
487
+          card.lastnr=0;card.setroot();card.checkautostart(true);
488
+#endif
489
+          beepshort(); ) ;
484 490
       break;
485 491
     case ItemP_disstep:
486 492
       MENUITEM(  lcdprintPGM(MSG_DISABLE_STEPPERS)  ,  BLOCK;enquecommand("M84");beepshort(); ) ;
@@ -1629,7 +1635,7 @@ void MainMenu::showControlMotion()
1629 1635
         if(linechanging)
1630 1636
         {
1631 1637
           if(encoderpos<5) encoderpos=5;
1632
-          if(encoderpos>99999) encoderpos=99999;
1638
+          if(encoderpos>32000) encoderpos=32000;//TODO: This is a problem, encoderpos is 16bit, but steps_per_unit for e can be wel over 800
1633 1639
           lcd.setCursor(11,line);lcd.print(ftostr52(encoderpos/100.0));
1634 1640
         }
1635 1641
         
@@ -1957,7 +1963,7 @@ void MainMenu::showMainMenu()
1957 1963
   #endif
1958 1964
   if(tune)
1959 1965
   {
1960
-    if(!(movesplanned() ||card.sdprinting))
1966
+    if(!(movesplanned() || IS_SD_PRINTING))
1961 1967
     {
1962 1968
       force_lcd_update=true;
1963 1969
       tune=false;
@@ -1965,7 +1971,7 @@ void MainMenu::showMainMenu()
1965 1971
   }
1966 1972
   else 
1967 1973
   {
1968
-    if(movesplanned() ||card.sdprinting)
1974
+    if(movesplanned() || IS_SD_PRINTING)
1969 1975
     {
1970 1976
       force_lcd_update=true;
1971 1977
       tune=true;

Loading…
Cancel
Save