We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 559cb35 commit 2d39bcbCopy full SHA for 2d39bcb
cores/esp8266/Updater.cpp
@@ -86,7 +86,7 @@ bool UpdaterClass::begin(size_t size, int command) {
86
//size of the update rounded to a sector
87
uint32_t roundedSize = (size + FLASH_SECTOR_SIZE - 1) & (~(FLASH_SECTOR_SIZE - 1));
88
//address where we will start writing the update
89
- updateStartAddress = updateEndAddress - roundedSize;
+ updateStartAddress = (updateEndAddress > roundedSize)? (updateEndAddress - roundedSize) : 0;
90
91
#ifdef DEBUG_UPDATER
92
DEBUG_UPDATER.printf("[begin] roundedSize: 0x%08X (%d)\n", roundedSize, roundedSize);
@@ -390,4 +390,4 @@ void UpdaterClass::printError(Print &out){
390
}
391
392
393
-UpdaterClass Update;
+UpdaterClass Update;
0 commit comments