|
@@ -456,7 +456,7 @@ static bool send_ok[BUFSIZE];
|
456
|
456
|
};
|
457
|
457
|
|
458
|
458
|
static MarlinBusyState busy_state = NOT_BUSY;
|
459
|
|
- static millis_t next_busy_signal_ms = -1;
|
|
459
|
+ static millis_t prev_busy_signal_ms = -1;
|
460
|
460
|
uint8_t host_keepalive_interval = DEFAULT_KEEPALIVE_INTERVAL;
|
461
|
461
|
#define KEEPALIVE_STATE(n) do{ busy_state = n; }while(0)
|
462
|
462
|
#else
|
|
@@ -2279,8 +2279,8 @@ void unknown_command_error() {
|
2279
|
2279
|
*/
|
2280
|
2280
|
void host_keepalive() {
|
2281
|
2281
|
millis_t ms = millis();
|
2282
|
|
- if (busy_state != NOT_BUSY) {
|
2283
|
|
- if (ms < next_busy_signal_ms) return;
|
|
2282
|
+ if (host_keepalive_interval && busy_state != NOT_BUSY) {
|
|
2283
|
+ if (ms - prev_busy_signal_ms < 1000UL * host_keepalive_interval) return;
|
2284
|
2284
|
switch (busy_state) {
|
2285
|
2285
|
case IN_HANDLER:
|
2286
|
2286
|
case IN_PROCESS:
|
|
@@ -2299,7 +2299,7 @@ void unknown_command_error() {
|
2299
|
2299
|
break;
|
2300
|
2300
|
}
|
2301
|
2301
|
}
|
2302
|
|
- next_busy_signal_ms = host_keepalive_interval ? ms + 1000UL * host_keepalive_interval : -1;
|
|
2302
|
+ prev_busy_signal_ms = ms;
|
2303
|
2303
|
}
|
2304
|
2304
|
|
2305
|
2305
|
#endif //HOST_KEEPALIVE_FEATURE
|