1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-10 14:42:08 +03:00

Only set flashmode byte when uploading an executable (#6891)

Fixes #6880

The updater was patching in the proper flashmode configuration byte for
all uploads, apps and filesystems.  This ended up corrupting one byte on
every FS upload.

Change updated to only patch theflashmode if it is doing an app.
This commit is contained in:
Earle F. Philhower, III
2019-12-08 19:34:04 -07:00
committed by GitHub
parent 1189417d9f
commit 7605dc1643

View File

@ -329,7 +329,7 @@ bool UpdaterClass::_writeBuffer(){
bool modifyFlashMode = false;
FlashMode_t flashMode = FM_QIO;
FlashMode_t bufferFlashMode = FM_QIO;
if (_currentAddress == _startAddress + FLASH_MODE_PAGE) {
if ((_currentAddress == _startAddress + FLASH_MODE_PAGE) && (_command == U_FLASH)) {
flashMode = ESP.getFlashChipMode();
#ifdef DEBUG_UPDATER
DEBUG_UPDATER.printf_P(PSTR("Header: 0x%1X %1X %1X %1X\n"), _buffer[0], _buffer[1], _buffer[2], _buffer[3]);