Fix AutoReporter implementation (#20959)

This commit is contained in:
X-Ryl669
2021-02-01 01:11:50 +01:00
committed by GitHub
parent 27366197f3
commit 07b4cc145b
7 changed files with 19 additions and 25 deletions

View File

@ -1226,9 +1226,7 @@ void CardReader::fileHasFinished() {
}
#if ENABLED(AUTO_REPORT_SD_STATUS)
TERN_(HAS_MULTI_SERIAL, serial_index_t CardReader::auto_report_port);
CardReader::AutoReportSD CardReader::auto_reporter;
void CardReader::AutoReportSD::auto_report() { report_status(); }
AutoReporter<CardReader::AutoReportSD> CardReader::auto_reporter;
#endif
#if ENABLED(POWER_LOSS_RECOVERY)

View File

@ -179,13 +179,8 @@ public:
//
// SD Auto Reporting
//
#if HAS_MULTI_SERIAL
static serial_index_t auto_report_port;
#else
static constexpr serial_index_t auto_report_port = 0;
#endif
class AutoReportSD : public AutoReporter<auto_report_port> { void auto_report(); };
static AutoReportSD auto_reporter;
struct AutoReportSD { static void report() { report_status(); } };
static AutoReporter<AutoReportSD> auto_reporter;
#endif
private: