1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-19 23:22:16 +03:00

Updater: read data back from flash before calculating MD5

This commit is contained in:
Ivan Grokhotkov 2016-06-16 16:25:17 +08:00
parent 44d27228c5
commit 0c58dc1536

View File

@ -202,12 +202,14 @@ bool UpdaterClass::end(bool evenIfRemaining){
}
bool UpdaterClass::_writeBuffer(){
if(!_async) yield();
bool result = ESP.flashEraseSector(_currentAddress/FLASH_SECTOR_SIZE);
if(!_async) yield();
if (result) {
result = ESP.flashWrite(_currentAddress, (uint32_t*) _buffer, _bufferLen);
if (result) {
result = ESP.flashRead(_currentAddress, (uint32_t*) _buffer, _bufferLen);
}
}
if(!_async) yield();