Skip to content

Commit

Permalink
OTA: STM32H7 remove _private_length private variable
Browse files Browse the repository at this point in the history
  • Loading branch information
pennam committed Jun 4, 2024
1 parent 2409695 commit 0ccd8a8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
7 changes: 4 additions & 3 deletions src/ota/implementation/OTASTM32H7.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ STM32H7OTACloudProcess::STM32H7OTACloudProcess(MessageStream *ms, Client* client
: OTADefaultCloudProcessInterface(ms, client)
, decompressed(nullptr)
, _bd_raw_qspi(nullptr)
, _program_length(0)
, _bd(nullptr)
, _fs(nullptr)
, _filename("/" + String(STM32H747OTA::FOLDER) + "/" + String(STM32H747OTA::NAME)) {
Expand Down Expand Up @@ -72,8 +71,10 @@ OTACloudProcessInterface::State STM32H7OTACloudProcess::flashOTA() {
fclose(decompressed);
decompressed = nullptr;

uint32_t updateLength = 0;

/* Schedule the firmware update. */
if(!findProgramLength(_program_length)) {
if(!findProgramLength(updateLength)) {
return OtaStorageOpenFail;
}

Expand All @@ -83,7 +84,7 @@ OTACloudProcessInterface::State STM32H7OTACloudProcess::flashOTA() {
STM32H747::writeBackupRegister(RTCBackup::DR0, STM32H747OTA::MAGIC);
STM32H747::writeBackupRegister(RTCBackup::DR1, STM32H747OTA::STORAGE_TYPE);
STM32H747::writeBackupRegister(RTCBackup::DR2, STM32H747OTA::PARTITION);
STM32H747::writeBackupRegister(RTCBackup::DR3, _program_length);
STM32H747::writeBackupRegister(RTCBackup::DR3, updateLength);

return Reboot;
}
Expand Down
1 change: 0 additions & 1 deletion src/ota/implementation/OTASTM32H7.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ class STM32H7OTACloudProcess: public OTADefaultCloudProcessInterface {

FILE* decompressed;
mbed::BlockDevice* _bd_raw_qspi;
uint32_t _program_length;

mbed::BlockDevice* _bd;
mbed::FATFileSystem* _fs;
Expand Down

0 comments on commit 0ccd8a8

Please sign in to comment.