Skip to content

Commit

Permalink
Fix RbootUpgrader to take notice of RBOOT_RTC_ENABLED (#2525)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikee47 authored Jul 15, 2022
1 parent 6cbbf6d commit fa026fb
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Sming/Arch/Esp8266/Platform/RTC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
RtcClass RTC;

#define RTC_MAGIC 0x55aaaa55
#define RTC_DES_ADDR 64
#define RTC_DES_ADDR 64 + 3 ///< rBoot may require 3 words at start
#define NS_PER_SECOND 1000000000

/** @brief Structure to hold RTC data
Expand Down
2 changes: 1 addition & 1 deletion Sming/Components/rboot/component.mk
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ endif

ifeq ($(RBOOT_RTC_ENABLED),1)
# enable the temporary switch to rom feature
APP_CFLAGS += -DBOOT_RTC_ENABLED
GLOBAL_CFLAGS += -DBOOT_RTC_ENABLED
endif

ifeq ($(RBOOT_GPIO_ENABLED),1)
Expand Down
2 changes: 2 additions & 0 deletions Sming/Libraries/Ota/component.mk
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ ifeq ($(COMPONENT_ARCH),Esp8266)
endif

COMPONENT_DOXYGEN_INPUT := src

COMPONENT_RELINK_VARS += RBOOT_RTC_ENABLED
4 changes: 2 additions & 2 deletions Sming/Libraries/Ota/src/Arch/Esp8266/RbootUpgrader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ bool RbootUpgrader::setBootPartition(Partition partition, bool save)
{
uint8_t slot = getSlotForPartition(partition);
if(!save) {
#ifdef RBOOT_ENABLE_RTC
#ifdef BOOT_RTC_ENABLED
return rboot_set_temp_rom(slot);
#else
return false;
Expand All @@ -63,7 +63,7 @@ bool RbootUpgrader::setBootPartition(Partition partition, bool save)
Partition RbootUpgrader::getRunningPartition()
{
uint8_t slot = rboot_get_current_rom();
#ifdef RBOOT_ENABLE_RTC
#ifdef BOOT_RTC_ENABLED
rboot_rtc_data rtc;
if(rboot_get_rtc_data(&rtc) && rtc.last_mode == MODE_TEMP_ROM) {
slot = rtc.last_rom;
Expand Down

0 comments on commit fa026fb

Please sign in to comment.