Browse Source

Implement basic HOST_KEEPALIVE_INTERVAL

Scott Lahteine 8 years ago
parent
commit
85883da90c
2 changed files with 6 additions and 1 deletions
  1. 4
    0
      Marlin/Marlin.h
  2. 2
    1
      Marlin/Marlin_main.cpp

+ 4
- 0
Marlin/Marlin.h View File

@@ -325,6 +325,10 @@ extern bool axis_homed[3]; // axis[n].is_homed
325 325
   extern float zprobe_zoffset;
326 326
 #endif
327 327
 
328
+#if ENABLED(HOST_KEEPALIVE_FEATURE)
329
+  extern uint8_t host_keepalive_interval;
330
+#endif
331
+
328 332
 #if ENABLED(PREVENT_DANGEROUS_EXTRUDE)
329 333
   extern float extrude_min_temp;
330 334
 #endif

+ 2
- 1
Marlin/Marlin_main.cpp View File

@@ -448,6 +448,7 @@ static bool send_ok[BUFSIZE];
448 448
 
449 449
   static MarlinBusyState busy_state = NOT_BUSY;
450 450
   static millis_t next_busy_signal_ms = -1;
451
+  uint8_t host_keepalive_interval = DEFAULT_KEEPALIVE_INTERVAL;
451 452
   #define KEEPALIVE_STATE(n) do{ busy_state = n; }while(0)
452 453
 #else
453 454
   #define host_keepalive() ;
@@ -2276,7 +2277,7 @@ void unknown_command_error() {
2276 2277
           break;
2277 2278
       }
2278 2279
     }
2279
-    next_busy_signal_ms = ms + 10000UL; // "busy: ..." message every 10s
2280
+    next_busy_signal_ms = host_keepalive_interval ? ms + 1000UL * host_keepalive_interval : -1;
2280 2281
   }
2281 2282
 
2282 2283
 #endif //HOST_KEEPALIVE_FEATURE

Loading…
Cancel
Save