From: Ivan Grokhotkov Date: Sat, 29 Sep 2018 06:01:35 +0000 (+0800) Subject: sleep: fix checking length of RTC data sections X-Git-Tag: v3.2-beta1~84^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c4a712b0bc74ec5ffe46f4bf77b5592e5cfcfaf8;p=esp-idf sleep: fix checking length of RTC data sections _rtc_data_{start,end} can now describe data placed into RTC_FAST segment, if CONFIG_ESP32_RTCDATA_IN_FAST_MEM is enabled. Use new _rtc_slow_length symbol instead. --- diff --git a/components/esp32/sleep_modes.c b/components/esp32/sleep_modes.c index 06ee4b259a..da4a5f11a5 100644 --- a/components/esp32/sleep_modes.c +++ b/components/esp32/sleep_modes.c @@ -637,15 +637,11 @@ static uint32_t get_power_down_flags() // If there is any data placed into .rtc.data or .rtc.bss segments, and // RTC_SLOW_MEM is Auto, keep it powered up as well. - // These labels are defined in the linker script: - extern int _rtc_data_start, _rtc_data_end, - _rtc_bss_start, _rtc_bss_end, - _rtc_noinit_start, _rtc_noinit_end; + // Labels are defined in the linker script, see esp32.ld. + extern int _rtc_slow_length; if ((s_config.pd_options[ESP_PD_DOMAIN_RTC_SLOW_MEM] == ESP_PD_OPTION_AUTO) && - (&_rtc_data_end > &_rtc_data_start || - &_rtc_bss_end > &_rtc_bss_start || - &_rtc_noinit_end > &_rtc_noinit_start || + ((size_t) &_rtc_slow_length > 0 || (s_config.wakeup_triggers & RTC_ULP_TRIG_EN))) { s_config.pd_options[ESP_PD_DOMAIN_RTC_SLOW_MEM] = ESP_PD_OPTION_ON; }