diff --git a/Sming/Components/Ota/src/Arch/Esp8266/RbootUpgrader.cpp b/Sming/Components/Ota/src/Arch/Esp8266/RbootUpgrader.cpp index c5ba55502e..bcd0dbfd29 100644 --- a/Sming/Components/Ota/src/Arch/Esp8266/RbootUpgrader.cpp +++ b/Sming/Components/Ota/src/Arch/Esp8266/RbootUpgrader.cpp @@ -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 diff --git a/Sming/Components/Ota/src/Arch/Esp8266/include/Ota/RbootUpgrader.h b/Sming/Components/Ota/src/Arch/Esp8266/include/Ota/RbootUpgrader.h index 34585071a4..8bf8901039 100644 --- a/Sming/Components/Ota/src/Arch/Esp8266/include/Ota/RbootUpgrader.h +++ b/Sming/Components/Ota/src/Arch/Esp8266/include/Ota/RbootUpgrader.h @@ -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 {