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
   extern float zprobe_zoffset;
325
   extern float zprobe_zoffset;
326
 #endif
326
 #endif
327
 
327
 
328
+#if ENABLED(HOST_KEEPALIVE_FEATURE)
329
+  extern uint8_t host_keepalive_interval;
330
+#endif
331
+
328
 #if ENABLED(PREVENT_DANGEROUS_EXTRUDE)
332
 #if ENABLED(PREVENT_DANGEROUS_EXTRUDE)
329
   extern float extrude_min_temp;
333
   extern float extrude_min_temp;
330
 #endif
334
 #endif

+ 2
- 1
Marlin/Marlin_main.cpp View File

448
 
448
 
449
   static MarlinBusyState busy_state = NOT_BUSY;
449
   static MarlinBusyState busy_state = NOT_BUSY;
450
   static millis_t next_busy_signal_ms = -1;
450
   static millis_t next_busy_signal_ms = -1;
451
+  uint8_t host_keepalive_interval = DEFAULT_KEEPALIVE_INTERVAL;
451
   #define KEEPALIVE_STATE(n) do{ busy_state = n; }while(0)
452
   #define KEEPALIVE_STATE(n) do{ busy_state = n; }while(0)
452
 #else
453
 #else
453
   #define host_keepalive() ;
454
   #define host_keepalive() ;
2276
           break;
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
 #endif //HOST_KEEPALIVE_FEATURE
2283
 #endif //HOST_KEEPALIVE_FEATURE

Loading…
Cancel
Save