@@ -326,8 +326,9 @@ static bool s_light_sleep_wakeup = false;
326326static portMUX_TYPE __attribute__((unused )) spinlock_rtc_deep_sleep = portMUX_INITIALIZER_UNLOCKED ;
327327
328328static const char * TAG = "sleep" ;
329- static RTC_FAST_ATTR int32_t s_sleep_sub_mode_ref_cnt [ESP_SLEEP_MODE_MAX ] = { 0 };
330- //in this mode, 2uA is saved, but RTC memory can't use at high temperature, and RTCIO can't be used as INPUT.
329+
330+ /* APP core of esp32 can't access to RTC FAST MEMORY, do not define it with RTC_IRAM_ATTR */
331+ RTC_SLOW_ATTR static int32_t s_sleep_sub_mode_ref_cnt [ESP_SLEEP_MODE_MAX ] = { 0 };
331332
332333void esp_sleep_overhead_out_time_refresh (void )
333334{
@@ -424,12 +425,12 @@ esp_deep_sleep_wake_stub_fn_t esp_get_deep_sleep_wake_stub(void)
424425}
425426
426427#if CONFIG_IDF_TARGET_ESP32
427- /* APP core of esp32 can't access to RTC FAST MEMORY, do not define it with RTC_IRAM_ATTR */
428- void
428+ /* APP core of esp32 can't access to RTC FAST MEMORY, link to RTC SLOW MEMORY instead */
429+ RTC_SLOW_ATTR
429430#else
430- void RTC_IRAM_ATTR
431+ RTC_IRAM_ATTR
431432#endif
432- esp_set_deep_sleep_wake_stub (esp_deep_sleep_wake_stub_fn_t new_stub )
433+ void esp_set_deep_sleep_wake_stub (esp_deep_sleep_wake_stub_fn_t new_stub )
433434{
434435#if SOC_PM_SUPPORT_DEEPSLEEP_CHECK_STUB_ONLY
435436 wake_stub_fn_handler = new_stub ;
@@ -438,7 +439,14 @@ esp_set_deep_sleep_wake_stub(esp_deep_sleep_wake_stub_fn_t new_stub)
438439#endif
439440}
440441
441- void RTC_IRAM_ATTR esp_default_wake_deep_sleep (void )
442+
443+ #if CONFIG_IDF_TARGET_ESP32
444+ /* APP core of esp32 can't access to RTC FAST MEMORY, link to RTC SLOW MEMORY instead*/
445+ RTC_SLOW_ATTR
446+ #else
447+ RTC_IRAM_ATTR
448+ #endif
449+ void esp_default_wake_deep_sleep (void )
442450{
443451 /* Clear MMU for CPU 0 */
444452#if CONFIG_IDF_TARGET_ESP32
@@ -2839,11 +2847,11 @@ static SLEEP_FN_ATTR uint32_t get_sleep_clock_icg_flags(void)
28392847
28402848#if CONFIG_IDF_TARGET_ESP32
28412849/* APP core of esp32 can't access to RTC FAST MEMORY, do not define it with RTC_IRAM_ATTR */
2842- void
2850+ RTC_SLOW_ATTR
28432851#else
2844- void RTC_IRAM_ATTR
2852+ RTC_IRAM_ATTR
28452853#endif
2846- esp_deep_sleep_disable_rom_logging (void )
2854+ void esp_deep_sleep_disable_rom_logging (void )
28472855{
28482856 rtc_suppress_rom_log ();
28492857}
0 commit comments