Skip to content

Commit

Permalink
rr compatiblity
Browse files Browse the repository at this point in the history
  • Loading branch information
markirb committed Jan 7, 2025
1 parent 733a97d commit 70fa680
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions libreset/src/shelly_reset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,16 @@ 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"

#include "sdkconfig.h"
#define RTC_SCRATCH_ADDR 0x50001ffc

#ifdef CONFIG_IDF_TARGET_ESP33
#include "esp32/rom/rtc.h"
#elif CONFIG_IDF_TARGET_ESP32C3
#include "esp32c3/rom/rtc.h"
#endif

#endif

#define FF_MODE_MAGIC 0x18365472
Expand Down Expand Up @@ -168,7 +176,7 @@ bool IsSoftReboot() {
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);
return (rr == (int) RESET_REASON_CORE_SW || rr == (int) RESET_REASON_CPU0_SW);
#else
return false;
#endif
Expand Down

0 comments on commit 70fa680

Please sign in to comment.