Bluetooth update doesn't overwrite DATA space

This commit is contained in:
Bertrand Songis
2019-05-07 15:51:23 +02:00
parent 439b2de621
commit 0d1945ae21
2 changed files with 17 additions and 12 deletions
+2 -2
View File
@@ -397,7 +397,7 @@ const char * Pxx2OtaUpdate::doFlashFirmware(const char * filename)
{
FIL file;
uint8_t buffer[32];
UINT count = 0;
UINT count;
OtaUpdateInformation * destination = moduleState[module].otaUpdateInformation;
destination->step = OTA_UPDATE_START;
@@ -413,7 +413,6 @@ const char * Pxx2OtaUpdate::doFlashFirmware(const char * filename)
uint32_t size = f_size(&file);
uint32_t done = 0;
while (1) {
done += count;
drawProgressScreen(getBasename(filename), "OTA update...", done, size);
if (f_read(&file, buffer, sizeof(buffer), &count) != FR_OK) {
f_close(&file);
@@ -428,6 +427,7 @@ const char * Pxx2OtaUpdate::doFlashFirmware(const char * filename)
f_close(&file);
break;
}
done += count;
}
destination->step = OTA_UPDATE_EOF;