mirror of
https://github.com/MarlinFirmware/Marlin.git
synced 2026-02-18 18:32:29 -07:00
Add AUTO_REPORT_SD_STATUS feature
For parity with 2.0.x ahead of 1.1.9 release.
This commit is contained in:
parent
b935bc948a
commit
fb9de6e787
4 changed files with 55 additions and 4 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue