From 7605dc164316344f16d513f35cf7aecfc4caf17f Mon Sep 17 00:00:00 2001 From: "Earle F. Philhower, III" Date: Sun, 8 Dec 2019 19:34:04 -0700 Subject: [PATCH] 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. --- cores/esp8266/Updater.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cores/esp8266/Updater.cpp b/cores/esp8266/Updater.cpp index b028e19b9..a8c443f62 100644 --- a/cores/esp8266/Updater.cpp +++ b/cores/esp8266/Updater.cpp @@ -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]);