Report sd card progress [FR] #9751 (#9832)

* SD Status auto-report feature
Feature Request #9751
This commit is contained in:
TheSFReader
2018-02-26 22:38:27 +01:00
committed by Scott Lahteine
parent 7bdb98c946
commit eb079959fb
50 changed files with 282 additions and 3 deletions

View File

@@ -99,6 +99,23 @@ public:
FORCE_INLINE char* getWorkDirName() { workDir.getFilename(filename); return filename; }
Sd2Card& getSd2Card() { return card; }
#if ENABLED(AUTO_REPORT_SD_STATUS)
void auto_report_sd_status(void);
FORCE_INLINE void set_auto_report_interval(uint8_t v
#if NUM_SERIAL > 1
, int8_t port
#endif
) {
#if NUM_SERIAL > 1
serialport = port;
#endif
NOMORE(v, 60);
auto_report_sd_interval = v;
next_sd_report_ms = millis() + 1000UL * v;
}
#endif
public:
bool saving, logging, sdprinting, cardOK, filenameIsDir;
char filename[FILENAME_LENGTH], longFilename[LONG_FILENAME_LENGTH];
@@ -183,6 +200,14 @@ private:
#if ENABLED(SDCARD_SORT_ALPHA)
void flush_presort();
#endif
#if ENABLED(AUTO_REPORT_SD_STATUS)
static uint8_t auto_report_sd_interval;
static millis_t next_sd_report_ms;
#if NUM_SERIAL > 1
static int8_t serialport;
#endif
#endif
};
#if PIN_EXISTS(SD_DETECT)