diff --git a/src/ATT_ESP8266.h b/src/ATT_ESP8266.h index a0bcb03..0809d50 100644 --- a/src/ATT_ESP8266.h +++ b/src/ATT_ESP8266.h @@ -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"); } } diff --git a/src/ATT_MKR1010.h b/src/ATT_MKR1010.h index 6a30ecb..005f2ed 100644 --- a/src/ATT_MKR1010.h +++ b/src/ATT_MKR1010.h @@ -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"); } }