mirror of
https://github.com/esp8266/Arduino.git
synced 2025-07-23 08:45:22 +03:00
add ESP.eraseESPconfig() to erase the ESP SDK configuration (including wifi)
improve WiFiMulti
This commit is contained in:
@ -294,3 +294,25 @@ String EspClass::getResetInfo(void) {
|
||||
struct rst_info * EspClass::getResetInfoPtr(void) {
|
||||
return &resetInfo;
|
||||
}
|
||||
|
||||
bool EspClass::eraseESPconfig(void) {
|
||||
bool ret = true;
|
||||
size_t cfgAddr = (ESP.getFlashChipSize() - 0x3000);
|
||||
size_t cfgSize = (8*1024);
|
||||
|
||||
noInterrupts();
|
||||
while(cfgSize) {
|
||||
|
||||
if(spi_flash_erase_sector((cfgAddr / SPI_FLASH_SEC_SIZE)) != SPI_FLASH_RESULT_OK) {
|
||||
ret = false;
|
||||
}
|
||||
|
||||
cfgSize -= SPI_FLASH_SEC_SIZE;
|
||||
cfgAddr += SPI_FLASH_SEC_SIZE;
|
||||
}
|
||||
interrupts();
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user