Skip to content

Commit

Permalink
Added better detection of running partition for rBoot.
Browse files Browse the repository at this point in the history
  • Loading branch information
slav-at-attachix committed May 25, 2021
1 parent c91b5f0 commit c9323e1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
13 changes: 13 additions & 0 deletions Sming/Components/Ota/src/Arch/Esp8266/RbootUpgrader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,17 @@ size_t RbootUpgrader::write(const uint8_t* buffer, size_t size)
return size;
}

Partition RbootUpgrader::getRunningPartition()
{
uint8_t slot = rboot_get_current_rom();
#ifdef RBOOT_ENABLE_RTC
rboot_rtc_data rtc;
rboot_get_rtc_data(&rtc);
if(rtc.last_mode == MODE_TEMP_ROM) {
slot = rtc.last_rom;
}
#endif
return getPartitionForSlot(slot);
}

} // namespace Ota
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,7 @@ class RbootUpgrader : public UpgraderBase
return getPartitionForSlot(rboot_get_current_rom());
}

Partition getRunningPartition() override
{
// TODO: ...
return getPartitionForSlot(rboot_get_current_rom());
}
Partition getRunningPartition() override;

Partition getNextBootPartition(Partition startFrom = {}) override
{
Expand Down

0 comments on commit c9323e1

Please sign in to comment.