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
   char* diveDirName;
64
   char* diveDirName;
65
   void lsDive(const char *prepend,SdFile parent);
65
   void lsDive(const char *prepend,SdFile parent);
66
 };
66
 };
67
-  
67
+#define IS_SD_PRINTING (card.sdprinting)
68
 
68
 
69
 #else
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
 #endif //SDSUPPORT
73
 #endif //SDSUPPORT
102
-#endif
74
+#endif

+ 3
- 5
Marlin/ultralcd.h View File

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

+ 10
- 4
Marlin/ultralcd.pde View File

12
 extern volatile int extrudemultiply;
12
 extern volatile int extrudemultiply;
13
 
13
 
14
 extern long position[4];   
14
 extern long position[4];   
15
+#ifdef SDSUPPORT
15
 extern CardReader card;
16
 extern CardReader card;
17
+#endif
16
 
18
 
17
 //===========================================================================
19
 //===========================================================================
18
 //=============================public variables============================
20
 //=============================public variables============================
480
       MENUITEM(  lcdprintPGM(MSG_MAIN)  ,  BLOCK;status=Main_Menu;beepshort(); ) ;
482
       MENUITEM(  lcdprintPGM(MSG_MAIN)  ,  BLOCK;status=Main_Menu;beepshort(); ) ;
481
       break;
483
       break;
482
     case ItemP_autostart:
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
       break;
490
       break;
485
     case ItemP_disstep:
491
     case ItemP_disstep:
486
       MENUITEM(  lcdprintPGM(MSG_DISABLE_STEPPERS)  ,  BLOCK;enquecommand("M84");beepshort(); ) ;
492
       MENUITEM(  lcdprintPGM(MSG_DISABLE_STEPPERS)  ,  BLOCK;enquecommand("M84");beepshort(); ) ;
1629
         if(linechanging)
1635
         if(linechanging)
1630
         {
1636
         {
1631
           if(encoderpos<5) encoderpos=5;
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
           lcd.setCursor(11,line);lcd.print(ftostr52(encoderpos/100.0));
1639
           lcd.setCursor(11,line);lcd.print(ftostr52(encoderpos/100.0));
1634
         }
1640
         }
1635
         
1641
         
1957
   #endif
1963
   #endif
1958
   if(tune)
1964
   if(tune)
1959
   {
1965
   {
1960
-    if(!(movesplanned() ||card.sdprinting))
1966
+    if(!(movesplanned() || IS_SD_PRINTING))
1961
     {
1967
     {
1962
       force_lcd_update=true;
1968
       force_lcd_update=true;
1963
       tune=false;
1969
       tune=false;
1965
   }
1971
   }
1966
   else 
1972
   else 
1967
   {
1973
   {
1968
-    if(movesplanned() ||card.sdprinting)
1974
+    if(movesplanned() || IS_SD_PRINTING)
1969
     {
1975
     {
1970
       force_lcd_update=true;
1976
       force_lcd_update=true;
1971
       tune=true;
1977
       tune=true;

Loading…
Cancel
Save