Skip to content

Commit

Permalink
Added delay when checking if device was successfully disconnected fro…
Browse files Browse the repository at this point in the history
…m WiFi to avoid crashes
  • Loading branch information
epiller committed Dec 3, 2019
1 parent 1557fa4 commit d1374be
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/ATT_ESP8266.h
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,9 @@ void Device::disconnectWiFi() {
disconnectAllThingsTalk();
WiFi.disconnect();
disconnectedWiFi = true;
while (WiFi.status() == WL_CONNECTED) {}
while (WiFi.status() == WL_CONNECTED) {
delay(1000);
}
debug("Successfully Disconnected from WiFi");
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/ATT_MKR1010.h
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,9 @@ void Device::disconnectWiFi() {
disconnectAllThingsTalk();
WiFi.disconnect();
disconnectedWiFi = true;
while (WiFi.status() == WL_CONNECTED) {}
while (WiFi.status() == WL_CONNECTED) {
delay(1000);
}
debug("Successfully Disconnected from WiFi");
}
}
Expand Down

0 comments on commit d1374be

Please sign in to comment.