use LL function to get wakeup cause

pull/10546/head
jiangguangming 2023-01-03 20:29:08 +08:00
rodzic 4b4491e736
commit f74a43d002
2 zmienionych plików z 2 dodań i 7 usunięć

Wyświetl plik

@ -1272,11 +1272,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;

Wyświetl plik

@ -445,8 +445,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;
}