Inline manage_inactivity, tweak autoreport_paused

This commit is contained in:
Scott Lahteine
2020-02-20 20:09:37 -06:00
parent 2b788e9aa6
commit a1f026f57a
7 changed files with 41 additions and 28 deletions

View File

@ -35,6 +35,18 @@ void safe_delay(millis_t ms) {
thermalManager.manage_heater(); // This keeps us safe if too many small safe_delay() calls are made
}
// A delay to provide brittle hosts time to receive bytes
#if ENABLED(SERIAL_OVERRUN_PROTECTION)
#include "../gcode/gcode.h" // for set_autoreport_paused
void serial_delay(const millis_t ms) {
const bool was = gcode.set_autoreport_paused(true);
safe_delay(ms);
gcode.set_autoreport_paused(was);
}
#endif
#if ENABLED(DEBUG_LEVELING_FEATURE)
#include "../module/probe.h"

View File

@ -27,14 +27,11 @@
// Delay that ensures heaters and watchdog are kept alive
void safe_delay(millis_t ms);
// A delay to provide brittle hosts time to receive bytes
inline void serial_delay(const millis_t ms) {
#if ENABLED(SERIAL_OVERRUN_PROTECTION)
safe_delay(ms);
#else
UNUSED(ms);
#endif
}
#if ENABLED(SERIAL_OVERRUN_PROTECTION)
void serial_delay(const millis_t ms);
#else
inline void serial_delay(const millis_t) {}
#endif
#if GRID_MAX_POINTS_X && GRID_MAX_POINTS_Y