Move M155 to cpp, auto-report to Temperature
This commit is contained in:
@ -2259,4 +2259,19 @@ void Temperature::isr() {
|
||||
#endif
|
||||
}
|
||||
|
||||
#if ENABLED(AUTO_REPORT_TEMPERATURES)
|
||||
|
||||
uint8_t Temperature::auto_report_temp_interval;
|
||||
millis_t Temperature::next_temp_report_ms;
|
||||
|
||||
void Temperature::auto_report_temperatures() {
|
||||
if (auto_report_temp_interval && ELAPSED(millis(), next_temp_report_ms)) {
|
||||
next_temp_report_ms = millis() + 1000UL * auto_report_temp_interval;
|
||||
print_heaterstates();
|
||||
SERIAL_EOL();
|
||||
}
|
||||
}
|
||||
|
||||
#endif // AUTO_REPORT_TEMPERATURES
|
||||
|
||||
#endif // HAS_TEMP_HOTEND || HAS_TEMP_BED
|
||||
|
@ -527,6 +527,16 @@ class Temperature {
|
||||
|
||||
#if HAS_TEMP_HOTEND || HAS_TEMP_BED
|
||||
static void print_heaterstates();
|
||||
#if ENABLED(AUTO_REPORT_TEMPERATURES)
|
||||
static uint8_t auto_report_temp_interval;
|
||||
static millis_t next_temp_report_ms;
|
||||
static void auto_report_temperatures(void);
|
||||
FORCE_INLINE void set_auto_report_interval(uint8_t v) {
|
||||
NOMORE(v, 60);
|
||||
auto_report_temp_interval = v;
|
||||
next_temp_report_ms = millis() + 1000UL * v;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
private:
|
||||
|
Reference in New Issue
Block a user