Keep automatic ESP-NOW retries paused during browser OTA
This commit is contained in:
1 parent
a294f01a5d
commit
0529a461f2
3 files changed
+60
No files matched your search
@@ -617,6 +617,9 @@ class MyMesh : public mesh::Mesh, public CommonCLICallbacks
|
||||
bool startSharedEspNowBridgeIfReady() {
|
||||
if (espnow_bridge.isRunning()) return true;
|
||||
if (!_prefs.espnow_bridge_enabled) return false;
|
||||
// Browser OTA pauses the bridges for the entire upload session. The
|
||||
// periodic retry must not undo that pause on its next loop iteration.
|
||||
if (_cli.getBoard()->isOTAUpdateRunning()) return false;
|
||||
if (mqtt_bridge && mqtt_bridge->isRunning() && !WiFi.isConnected()) return false;
|
||||
if (!millisHasNowPassed(shared_espnow_retry_at)) return false;
|
||||
shared_espnow_retry_at = millis() + 5000;
|
||||
|
||||
@@ -580,6 +580,8 @@ public:
|
||||
bool startSharedEspNowBridgeIfReady() {
|
||||
if (espnow_bridge.isRunning()) return true;
|
||||
if (!_prefs.espnow_bridge_enabled) return false;
|
||||
// Keep the browser uploader's bridge pause in effect until OTA stops.
|
||||
if (_cli.getBoard()->isOTAUpdateRunning()) return false;
|
||||
if (bridge && bridge->isRunning() && !WiFi.isConnected()) return false;
|
||||
if (!millisHasNowPassed(shared_espnow_retry_at)) return false;
|
||||
shared_espnow_retry_at = millis() + 5000;
|
||||
|
||||
Reference in new issue
Block a user