made cardreader more selfsustained

This commit is contained in:
Bernhard Kubicek
2011-11-06 22:48:15 +01:00
parent 01df04e02c
commit fc0064e525
4 changed files with 149 additions and 100 deletions

View File

@ -18,26 +18,38 @@ public:
void checkautostart(bool x);
void closefile();
void release();
void startFileprint();
void startFilewrite(char *name);
void pauseSDPrint();
void getStatus();
void selectFile(char* name);
void getfilename(const uint8_t nr);
uint8_t getnrfilenames();
inline void ls() {root.ls();};
inline bool eof() { sdpos = file.curPosition();return sdpos>=filesize ;};
inline char get() { int16_t n = file.read(); return (n!=-1)?(char)n:'\n';};
inline void setIndex(long index) {sdpos = index;file.seekSet(index);};
public:
bool savetosd;
SdFile file;
uint32_t filesize;
uint32_t sdpos ;
bool sdmode ;
SdFile root;
bool sdactive ;
bool saving;
bool sdprinting ;
bool cardOK ;
char filename[11];
private:
Sd2Card card;
SdVolume volume;
SdFile root;
Sd2Card card;
SdVolume volume;
SdFile file;
uint32_t filesize;
//int16_t n;
unsigned long autostart_atmillis;
uint32_t sdpos ;
//int16_t n;
unsigned long autostart_atmillis;
bool autostart_stilltocheck; //the sd start is delayed, because otherwise the serial cannot answer fast enought to make contact with the hostsoftware.
bool autostart_stilltocheck; //the sd start is delayed, because otherwise the serial cannot answer fast enought to make contact with the hostsoftware.
};
#endif //SDSUPPORT