fix esp32 erase w persistent

This commit is contained in:
Shawn A
2018-06-18 15:27:47 -05:00
parent 10088c71f3
commit b3e19041ff
2 changed files with 6 additions and 1 deletions
+5 -1
View File
@@ -2352,8 +2352,12 @@ bool WiFiManager::WiFi_eraseConfig() {
return true;
#endif
#elif defined(ESP32)
bool ret;
WiFi.mode(WIFI_AP_STA); // cannot erase if not in STA mode !
return WiFi.disconnect(true);
WiFi.persistent(true);
ret = WiFi.disconnect(true);
WiFi.persistent(false);
return ret;
#endif
}
+1
View File
@@ -311,6 +311,7 @@ class WiFiManager
boolean _disableIpFields = false; // edge case, if true, showxFields(false) forces ip fields off instead of default show when set
// wrapper functions for handling setting and unsetting persistent for now.
bool esp32persistent = false;
bool _hasBegun = false;
void _begin();
void _end();