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