Fix the bug where the SD percentage calculation is wrong when the file is larger then 42MB

This commit is contained in:
daid303 2012-12-03 11:35:36 +01:00
parent 34b2de4cd8
commit 6c51fe5039

View File

@ -38,7 +38,7 @@ public:
FORCE_INLINE bool eof() { return sdpos>=filesize ;}; FORCE_INLINE bool eof() { return sdpos>=filesize ;};
FORCE_INLINE int16_t get() { sdpos = file.curPosition();return (int16_t)file.read();}; FORCE_INLINE int16_t get() { sdpos = file.curPosition();return (int16_t)file.read();};
FORCE_INLINE void setIndex(long index) {sdpos = index;file.seekSet(index);}; FORCE_INLINE void setIndex(long index) {sdpos = index;file.seekSet(index);};
FORCE_INLINE uint8_t percentDone(){if(!sdprinting) return 0; if(filesize) return sdpos*100/filesize; else return 0;}; FORCE_INLINE uint8_t percentDone(){if(!sdprinting) return 0; if(filesize) return sdpos/((filesize+99)/100); else return 0;};
FORCE_INLINE char* getWorkDirName(){workDir.getFilename(filename);return filename;}; FORCE_INLINE char* getWorkDirName(){workDir.getFilename(filename);return filename;};
public: public:
@ -73,4 +73,4 @@ private:
#define IS_SD_PRINTING (false) #define IS_SD_PRINTING (false)
#endif //SDSUPPORT #endif //SDSUPPORT
#endif #endif