AutoReport class (Temperature, Cardreader) (#20913)

This commit is contained in:
Scott Lahteine
2021-01-28 20:40:20 -06:00
committed by GitHub
parent 9e004a9496
commit 9d0e64a725
16 changed files with 110 additions and 84 deletions

View File

@@ -33,6 +33,10 @@
#include "../feature/power.h"
#endif
#if ENABLED(AUTO_REPORT_TEMPERATURES)
#include "../libs/autoreport.h"
#endif
#ifndef SOFT_PWM_SCALE
#define SOFT_PWM_SCALE 0
#endif
@@ -794,14 +798,8 @@ class Temperature {
#endif
);
#if ENABLED(AUTO_REPORT_TEMPERATURES)
static uint8_t auto_report_temp_interval;
static millis_t next_temp_report_ms;
static void auto_report_temperatures();
static inline void set_auto_report_interval(uint8_t v) {
NOMORE(v, 60);
auto_report_temp_interval = v;
next_temp_report_ms = millis() + 1000UL * v;
}
class AutoReportTemp : public AutoReporter<SERIAL_ALL> { void auto_report(); };
static AutoReportTemp auto_reporter;
#endif
#endif