Add AUTO_REPORT_SD_STATUS feature

For parity with 2.0.x ahead of 1.1.9 release.
This commit is contained in:
Scott Lahteine
2018-03-07 00:06:03 -06:00
parent b935bc948a
commit fb9de6e787
4 changed files with 55 additions and 4 deletions

View File

@@ -911,4 +911,17 @@ void CardReader::printingHasFinished() {
}
}
#if ENABLED(AUTO_REPORT_SD_STATUS)
uint8_t CardReader::auto_report_sd_interval = 0;
millis_t CardReader::next_sd_report_ms;
void CardReader::auto_report_sd_status() {
millis_t current_ms = millis();
if (auto_report_sd_interval && ELAPSED(current_ms, next_sd_report_ms)) {
next_sd_report_ms = current_ms + 1000UL * auto_report_sd_interval;
getStatus();
}
}
#endif // AUTO_REPORT_SD_STATUS
#endif // SDSUPPORT