|
|
@ -89,15 +89,19 @@ void systemLoop() { |
|
|
|
// Heartbeat
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
|
|
|
|
#if HEARTBEAT_ENABLED
|
|
|
|
// Heartbeat
|
|
|
|
#if HEARTBEAT_MODE == HEARTBEAT_ONCE
|
|
|
|
if (_system_send_heartbeat) { |
|
|
|
_system_send_heartbeat = false; |
|
|
|
heartbeat(); |
|
|
|
} |
|
|
|
#elif HEARTBEAT_MODE == HEARTBEAT_REPEAT
|
|
|
|
static unsigned long last_hbeat = 0; |
|
|
|
if (_system_send_heartbeat || (last_hbeat == 0) || (millis() - last_hbeat > HEARTBEAT_INTERVAL)) { |
|
|
|
_system_send_heartbeat = false; |
|
|
|
last_hbeat = millis(); |
|
|
|
heartbeat(); |
|
|
|
} |
|
|
|
#endif // HEARTBEAT_ENABLED
|
|
|
|
#endif // HEARTBEAT_MODE == HEARTBEAT_REPEAT
|
|
|
|
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
// Load Average calculation
|
|
|
|