kopia lustrzana https://github.com/espressif/esp-idf
use LL function to get wakeup cause
rodzic
4b4491e736
commit
f74a43d002
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue