From 85883da90c00eafdbb13d2aa76c8af19ec283468 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 6 Apr 2016 17:31:18 -0700 Subject: [PATCH] Implement basic HOST_KEEPALIVE_INTERVAL --- Marlin/Marlin.h | 4 ++++ Marlin/Marlin_main.cpp | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index 8fb742e0d..3c13fa216 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -325,6 +325,10 @@ extern bool axis_homed[3]; // axis[n].is_homed extern float zprobe_zoffset; #endif +#if ENABLED(HOST_KEEPALIVE_FEATURE) + extern uint8_t host_keepalive_interval; +#endif + #if ENABLED(PREVENT_DANGEROUS_EXTRUDE) extern float extrude_min_temp; #endif diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 8a3610d58..9a1e3ae6c 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -448,6 +448,7 @@ static bool send_ok[BUFSIZE]; static MarlinBusyState busy_state = NOT_BUSY; static millis_t next_busy_signal_ms = -1; + uint8_t host_keepalive_interval = DEFAULT_KEEPALIVE_INTERVAL; #define KEEPALIVE_STATE(n) do{ busy_state = n; }while(0) #else #define host_keepalive() ; @@ -2276,7 +2277,7 @@ void unknown_command_error() { break; } } - next_busy_signal_ms = ms + 10000UL; // "busy: ..." message every 10s + next_busy_signal_ms = host_keepalive_interval ? ms + 1000UL * host_keepalive_interval : -1; } #endif //HOST_KEEPALIVE_FEATURE