Inline manage_inactivity, tweak autoreport_paused
This commit is contained in:
@ -53,7 +53,7 @@ GcodeSuite gcode;
|
||||
#include "../feature/cancel_object.h"
|
||||
#endif
|
||||
|
||||
#include "../MarlinCore.h" // for idle() and suspend_auto_report
|
||||
#include "../MarlinCore.h" // for idle()
|
||||
|
||||
millis_t GcodeSuite::previous_move_ms;
|
||||
|
||||
@ -66,6 +66,10 @@ uint8_t GcodeSuite::axis_relative = (
|
||||
| (ar_init.e ? _BV(REL_E) : 0)
|
||||
);
|
||||
|
||||
#if HAS_AUTO_REPORTING || ENABLED(HOST_KEEPALIVE_FEATURE)
|
||||
bool GcodeSuite::autoreport_paused; // = false
|
||||
#endif
|
||||
|
||||
#if ENABLED(HOST_KEEPALIVE_FEATURE)
|
||||
GcodeSuite::MarlinBusyState GcodeSuite::busy_state = NOT_BUSY;
|
||||
uint8_t GcodeSuite::host_keepalive_interval = DEFAULT_KEEPALIVE_INTERVAL;
|
||||
@ -942,7 +946,7 @@ void GcodeSuite::process_subcommands_now(char * gcode) {
|
||||
void GcodeSuite::host_keepalive() {
|
||||
const millis_t ms = millis();
|
||||
static millis_t next_busy_signal_ms = 0;
|
||||
if (!suspend_auto_report && host_keepalive_interval && busy_state != NOT_BUSY) {
|
||||
if (!autoreport_paused && host_keepalive_interval && busy_state != NOT_BUSY) {
|
||||
if (PENDING(ms, next_busy_signal_ms)) return;
|
||||
switch (busy_state) {
|
||||
case IN_HANDLER:
|
||||
|
@ -351,6 +351,18 @@ public:
|
||||
process_subcommands_now_P(G28_STR);
|
||||
}
|
||||
|
||||
#if HAS_AUTO_REPORTING || ENABLED(HOST_KEEPALIVE_FEATURE)
|
||||
static bool autoreport_paused;
|
||||
static inline bool set_autoreport_paused(const bool p) {
|
||||
const bool was = autoreport_paused;
|
||||
autoreport_paused = p;
|
||||
return was;
|
||||
}
|
||||
#else
|
||||
static constexpr bool autoreport_paused = false;
|
||||
static inline bool set_autoreport_paused(const bool) { return false; }
|
||||
#endif
|
||||
|
||||
#if ENABLED(HOST_KEEPALIVE_FEATURE)
|
||||
/**
|
||||
* States for managing Marlin and host communication
|
||||
|
Reference in New Issue
Block a user