|
@ -10,8 +10,6 @@ Copyright (C) 2019 by Xose Pérez <xose dot perez at gmail dot com> |
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
unsigned long _loop_delay = 0; |
|
|
|
|
|
|
|
|
|
|
|
bool _system_send_heartbeat = false; |
|
|
bool _system_send_heartbeat = false; |
|
|
unsigned char _heartbeat_mode = HEARTBEAT_MODE; |
|
|
unsigned char _heartbeat_mode = HEARTBEAT_MODE; |
|
|
unsigned long _heartbeat_interval = HEARTBEAT_INTERVAL; |
|
|
unsigned long _heartbeat_interval = HEARTBEAT_INTERVAL; |
|
@ -73,10 +71,6 @@ bool systemGetHeartbeat() { |
|
|
return _system_send_heartbeat; |
|
|
return _system_send_heartbeat; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
unsigned long systemLoopDelay() { |
|
|
|
|
|
return _loop_delay; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
unsigned long systemLoadAverage() { |
|
|
unsigned long systemLoadAverage() { |
|
|
return _load_average; |
|
|
return _load_average; |
|
|
} |
|
|
} |
|
@ -153,11 +147,6 @@ void systemLoop() { |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
|
|
// Power saving delay
|
|
|
|
|
|
// -------------------------------------------------------------------------
|
|
|
|
|
|
if (_loop_delay) delay(_loop_delay); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void _systemSetupSpecificHardware() { |
|
|
void _systemSetupSpecificHardware() { |
|
@ -194,10 +183,6 @@ void systemSetup() { |
|
|
// Init device-specific hardware
|
|
|
// Init device-specific hardware
|
|
|
_systemSetupSpecificHardware(); |
|
|
_systemSetupSpecificHardware(); |
|
|
|
|
|
|
|
|
// Cache loop delay value to speed things (recommended max 250ms)
|
|
|
|
|
|
_loop_delay = atol(getSetting("loopDelay", LOOP_DELAY_TIME).c_str()); |
|
|
|
|
|
_loop_delay = constrain(_loop_delay, 0, 300); |
|
|
|
|
|
|
|
|
|
|
|
// Register Loop
|
|
|
// Register Loop
|
|
|
espurnaRegisterLoop(systemLoop); |
|
|
espurnaRegisterLoop(systemLoop); |
|
|
|
|
|
|
|
|