use LL function to get wakeup cause

This commit is contained in:
jiangguangming 2023-01-03 20:29:08 +08:00 committed by wuzhenghui
parent 96f3c2bac6
commit 85064f164f
2 changed files with 2 additions and 7 deletions

View File

@ -1239,11 +1239,7 @@ esp_sleep_wakeup_cause_t esp_sleep_get_wakeup_cause(void)
return ESP_SLEEP_WAKEUP_UNDEFINED;
}
#ifdef CONFIG_IDF_TARGET_ESP32
uint32_t wakeup_cause = REG_GET_FIELD(RTC_CNTL_WAKEUP_STATE_REG, RTC_CNTL_WAKEUP_CAUSE);
#else
uint32_t wakeup_cause = REG_GET_FIELD(RTC_CNTL_SLP_WAKEUP_CAUSE_REG, RTC_CNTL_WAKEUP_CAUSE);
#endif
uint32_t wakeup_cause = rtc_cntl_ll_get_wakeup_cause();
if (wakeup_cause & RTC_TIMER_TRIG_EN) {
return ESP_SLEEP_WAKEUP_TIMER;

View File

@ -430,8 +430,7 @@ __attribute__((unused)) static float get_time_ms(void)
__attribute__((unused)) static uint32_t get_cause(void)
{
uint32_t wakeup_cause = REG_GET_FIELD(RTC_CNTL_WAKEUP_STATE_REG, \
RTC_CNTL_WAKEUP_CAUSE);
uint32_t wakeup_cause = rtc_cntl_ll_get_wakeup_cause();
return wakeup_cause;
}