Fixed general 16x2 LCD build without SD support.

2.0.x
Daid 13 years ago
parent d47b666630
commit 3d83109028

@ -64,39 +64,11 @@ private:
char* diveDirName; char* diveDirName;
void lsDive(const char *prepend,SdFile parent); void lsDive(const char *prepend,SdFile parent);
}; };
#define IS_SD_PRINTING (card.sdprinting)
#else #else
#define dir_t bool #define IS_SD_PRINTING (false)
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;};
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 //SDSUPPORT
#endif #endif

@ -129,6 +129,7 @@
//conversion routines, could need some overworking //conversion routines, could need some overworking
char *ftostr51(const float &x); char *ftostr51(const float &x);
char *ftostr52(const float &x);
char *ftostr31(const float &x); char *ftostr31(const float &x);
char *ftostr3(const float &x); char *ftostr3(const float &x);
@ -142,10 +143,8 @@
#define LCD_MESSAGE(x) #define LCD_MESSAGE(x)
#define LCD_MESSAGEPGM(x) #define LCD_MESSAGEPGM(x)
FORCE_INLINE void lcd_status() {}; FORCE_INLINE void lcd_status() {};
#endif
#ifndef ULTIPANEL #define CLICKED false
#define CLICKED false
#define BLOCK ; #define BLOCK ;
#endif #endif
@ -160,4 +159,3 @@ char *itostr3(const int &xx);
char *itostr4(const int &xx); char *itostr4(const int &xx);
char *ftostr51(const float &x); char *ftostr51(const float &x);
#endif //ULTRALCD #endif //ULTRALCD

@ -12,7 +12,9 @@ extern volatile bool feedmultiplychanged;
extern volatile int extrudemultiply; extern volatile int extrudemultiply;
extern long position[4]; extern long position[4];
#ifdef SDSUPPORT
extern CardReader card; extern CardReader card;
#endif
//=========================================================================== //===========================================================================
//=============================public variables============================ //=============================public variables============================
@ -480,7 +482,11 @@ void MainMenu::showPrepare()
MENUITEM( lcdprintPGM(MSG_MAIN) , BLOCK;status=Main_Menu;beepshort(); ) ; MENUITEM( lcdprintPGM(MSG_MAIN) , BLOCK;status=Main_Menu;beepshort(); ) ;
break; break;
case ItemP_autostart: 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; break;
case ItemP_disstep: case ItemP_disstep:
MENUITEM( lcdprintPGM(MSG_DISABLE_STEPPERS) , BLOCK;enquecommand("M84");beepshort(); ) ; MENUITEM( lcdprintPGM(MSG_DISABLE_STEPPERS) , BLOCK;enquecommand("M84");beepshort(); ) ;
@ -1629,7 +1635,7 @@ void MainMenu::showControlMotion()
if(linechanging) if(linechanging)
{ {
if(encoderpos<5) encoderpos=5; 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)); lcd.setCursor(11,line);lcd.print(ftostr52(encoderpos/100.0));
} }
@ -1957,7 +1963,7 @@ void MainMenu::showMainMenu()
#endif #endif
if(tune) if(tune)
{ {
if(!(movesplanned() ||card.sdprinting)) if(!(movesplanned() || IS_SD_PRINTING))
{ {
force_lcd_update=true; force_lcd_update=true;
tune=false; tune=false;
@ -1965,7 +1971,7 @@ void MainMenu::showMainMenu()
} }
else else
{ {
if(movesplanned() ||card.sdprinting) if(movesplanned() || IS_SD_PRINTING)
{ {
force_lcd_update=true; force_lcd_update=true;
tune=true; tune=true;

Loading…
Cancel
Save