From 564f5b5a6d541e897cdfebd188c2883c23cc5403 Mon Sep 17 00:00:00 2001 From: Markus Kirberg Date: Tue, 7 Jan 2025 19:16:44 +0000 Subject: [PATCH] rr compatiblity --- libreset/src/shelly_reset.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libreset/src/shelly_reset.cpp b/libreset/src/shelly_reset.cpp index e7649a5e..fbad006e 100644 --- a/libreset/src/shelly_reset.cpp +++ b/libreset/src/shelly_reset.cpp @@ -34,8 +34,10 @@ extern "C" uint32_t rtc_get_reset_reason(void); // so we can repurpose this location for failsafe flag. #define RTC_SCRATCH_ADDR 0x600011fc #elif CS_PLATFORM == CS_P_ESP32 -#include "esp32/rom/rtc.h" + #define RTC_SCRATCH_ADDR 0x50001ffc +#include "esp_rom_sys.h" + #endif #define FF_MODE_MAGIC 0x18365472 @@ -167,8 +169,8 @@ bool IsSoftReboot() { const struct rst_info *ri = system_get_rst_info(); return (ri->reason == REASON_SOFT_RESTART); #elif CS_PLATFORM == CS_P_ESP32 - RESET_REASON rr = rtc_get_reset_reason(0 /* core */); - return (rr == SW_RESET || rr == SW_CPU_RESET); + esp_reset_reason_t rr = esp_rom_get_reset_reason(0 /* core */); + return (rr == RESET_REASON_CORE_SW || rr == RESET_REASON_CPU0_SW); #else return false; #endif