From 696b920273e8122cf4dff37d6f90e558950bfc7d Mon Sep 17 00:00:00 2001 From: tablatronix <807787+tablatronix@users.noreply.github.com> Date: Tue, 20 Sep 2022 22:11:52 -0500 Subject: [PATCH] update rtc for resetreasons on multiple models --- WiFiManager.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/WiFiManager.h b/WiFiManager.h index 116dc60..19d2463 100644 --- a/WiFiManager.h +++ b/WiFiManager.h @@ -109,7 +109,21 @@ #endif #ifdef WM_RTC - #include + #ifdef ESP_IDF_VERSION_MAJOR // IDF 4+ + #if CONFIG_IDF_TARGET_ESP32 // ESP32/PICO-D4 + #include "esp32/rom/rtc.h" + #elif CONFIG_IDF_TARGET_ESP32S2 + #include "esp32s2/rom/rtc.h" + #elif CONFIG_IDF_TARGET_ESP32C3 + #include "esp32c3/rom/rtc.h" + #elif CONFIG_IDF_TARGET_ESP32S3 + #include "esp32s3/rom/rtc.h" + #else + #error Target CONFIG_IDF_TARGET is not supported + #endif + #else // ESP32 Before IDF 4.0 + #include "rom/rtc.h" + #endif #endif #else