diff --git a/Sming/Arch/Esp8266/Platform/RTC.cpp b/Sming/Arch/Esp8266/Platform/RTC.cpp index 5969cbf2a6..b06db69d65 100644 --- a/Sming/Arch/Esp8266/Platform/RTC.cpp +++ b/Sming/Arch/Esp8266/Platform/RTC.cpp @@ -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 diff --git a/Sming/Components/rboot/component.mk b/Sming/Components/rboot/component.mk index 3a99722dfc..7a88aac668 100644 --- a/Sming/Components/rboot/component.mk +++ b/Sming/Components/rboot/component.mk @@ -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) diff --git a/Sming/Libraries/Ota/component.mk b/Sming/Libraries/Ota/component.mk index 964bde20cb..a06ea4d292 100644 --- a/Sming/Libraries/Ota/component.mk +++ b/Sming/Libraries/Ota/component.mk @@ -18,3 +18,5 @@ ifeq ($(COMPONENT_ARCH),Esp8266) endif COMPONENT_DOXYGEN_INPUT := src + +COMPONENT_RELINK_VARS += RBOOT_RTC_ENABLED diff --git a/Sming/Libraries/Ota/src/Arch/Esp8266/RbootUpgrader.cpp b/Sming/Libraries/Ota/src/Arch/Esp8266/RbootUpgrader.cpp index 50bbe5b372..b143b77126 100644 --- a/Sming/Libraries/Ota/src/Arch/Esp8266/RbootUpgrader.cpp +++ b/Sming/Libraries/Ota/src/Arch/Esp8266/RbootUpgrader.cpp @@ -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; @@ -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;