mirror of
https://github.com/airgradienthq/arduino.git
synced 2025-12-22 23:12:36 +01:00
Feed watchdog when BLE client is connected
This commit is contained in:
@@ -208,6 +208,8 @@ bool WifiConnector::connect(String modelName) {
|
||||
sm.ledAnimationInit();
|
||||
sm.handleLeds(AgStateMachineWiFiManagerPortalActive);
|
||||
|
||||
uint32_t wdMillis = 0;
|
||||
|
||||
// Loop until the BLE client disconnected or WiFi connected
|
||||
while (isBleClientConnected() && !WiFi.isConnected()) {
|
||||
EventBits_t bits = xEventGroupWaitBits(
|
||||
@@ -257,6 +259,12 @@ bool WifiConnector::connect(String modelName) {
|
||||
handleBleScanRequest();
|
||||
}
|
||||
|
||||
// Ensure watchdog fed every minute
|
||||
if ((millis() - wdMillis) >= 60000) {
|
||||
wdMillis = millis();
|
||||
ag->watchdog.reset();
|
||||
}
|
||||
|
||||
delay(1);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user