M808 Repeat Markers (#20084)

This commit is contained in:
Scott Lahteine
2020-11-26 21:18:40 -06:00
committed by GitHub
parent c61a311c0d
commit b6a32500c4
16 changed files with 248 additions and 15 deletions

View File

@ -699,8 +699,7 @@ void CardReader::removeFile(const char * const name) {
void CardReader::report_status() {
if (isPrinting()) {
SERIAL_ECHOPGM(STR_SD_PRINTING_BYTE);
SERIAL_ECHO(sdpos);
SERIAL_ECHOPAIR(STR_SD_PRINTING_BYTE, sdpos);
SERIAL_CHAR('/');
SERIAL_ECHOLN(filesize);
}

View File

@ -159,9 +159,9 @@ public:
static inline uint32_t getIndex() { return sdpos; }
static inline uint32_t getFileSize() { return filesize; }
static inline bool eof() { return sdpos >= filesize; }
static inline void setIndex(const uint32_t index) { sdpos = index; file.seekSet(index); }
static inline void setIndex(const uint32_t index) { file.seekSet((sdpos = index)); }
static inline char* getWorkDirName() { workDir.getDosName(filename); return filename; }
static inline int16_t get() { sdpos = file.curPosition(); return (int16_t)file.read(); }
static inline int16_t get() { int16_t out = (int16_t)file.read(); sdpos = file.curPosition(); return out; }
static inline int16_t read(void* buf, uint16_t nbyte) { return file.isOpen() ? file.read(buf, nbyte) : -1; }
static inline int16_t write(void* buf, uint16_t nbyte) { return file.isOpen() ? file.write(buf, nbyte) : -1; }
@ -244,7 +244,8 @@ private:
static SdVolume volume;
static SdFile file;
static uint32_t filesize, sdpos;
static uint32_t filesize, // Total size of the current file, in bytes
sdpos; // Index most recently read (one behind file.getPos)
//
// Procedure calls to other files