Skip to content

Commit 4edf9b4

Browse files
committed
OTA: STM32H7 remove _private_length private variable
1 parent 340ab06 commit 4edf9b4

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/ota/implementation/OTASTM32H7.cpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ STM32H7OTACloudProcess::STM32H7OTACloudProcess(MessageStream *ms, Client* client
1717
: OTADefaultCloudProcessInterface(ms, client)
1818
, decompressed(nullptr)
1919
, _bd_raw_qspi(nullptr)
20-
, _program_length(0)
2120
, _bd(nullptr)
2221
, _fs(nullptr)
2322
, _filename("/" + String(STM32H747OTA::FOLDER) + "/" + String(STM32H747OTA::NAME)) {
@@ -72,8 +71,10 @@ OTACloudProcessInterface::State STM32H7OTACloudProcess::flashOTA() {
7271
fclose(decompressed);
7372
decompressed = nullptr;
7473

74+
uint32_t updateLength = 0;
75+
7576
/* Schedule the firmware update. */
76-
if(!findProgramLength(_program_length)) {
77+
if(!findProgramLength(updateLength)) {
7778
return OtaStorageOpenFail;
7879
}
7980

@@ -83,7 +84,7 @@ OTACloudProcessInterface::State STM32H7OTACloudProcess::flashOTA() {
8384
STM32H747::writeBackupRegister(RTCBackup::DR0, STM32H747OTA::MAGIC);
8485
STM32H747::writeBackupRegister(RTCBackup::DR1, STM32H747OTA::STORAGE_TYPE);
8586
STM32H747::writeBackupRegister(RTCBackup::DR2, STM32H747OTA::PARTITION);
86-
STM32H747::writeBackupRegister(RTCBackup::DR3, _program_length);
87+
STM32H747::writeBackupRegister(RTCBackup::DR3, updateLength);
8788

8889
return Reboot;
8990
}

src/ota/implementation/OTASTM32H7.h

-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ class STM32H7OTACloudProcess: public OTADefaultCloudProcessInterface {
6969

7070
FILE* decompressed;
7171
mbed::BlockDevice* _bd_raw_qspi;
72-
uint32_t _program_length;
7372

7473
mbed::BlockDevice* _bd;
7574
mbed::FATFileSystem* _fs;

0 commit comments

Comments
 (0)