Adds timing macro

This commit is contained in:
Rune Harlyk
2024-07-14 23:14:07 +02:00
committed by Rune Harlyk
parent c783793b5c
commit 200ea62d95
11 changed files with 41 additions and 62 deletions
@@ -60,16 +60,8 @@ void WiFiSettingsService::reconfigureWiFiConnection() {
}
void WiFiSettingsService::loop() {
unsigned long currentMillis = millis();
if (!_lastConnectionAttempt || (unsigned long)(currentMillis - _lastConnectionAttempt) >= WIFI_RECONNECTION_DELAY) {
_lastConnectionAttempt = currentMillis;
manageSTA();
}
if (!_lastRssiUpdate || (unsigned long)(currentMillis - _lastRssiUpdate) >= RSSI_EVENT_DELAY) {
_lastRssiUpdate = currentMillis;
updateRSSI();
}
EXECUTE_EVERY_N_MS(WIFI_RECONNECTION_DELAY, manageSTA());
EXECUTE_EVERY_N_MS(RSSI_EVENT_DELAY, updateRSSI());
}
String WiFiSettingsService::getHostname() { return _state.hostname; }