fix(ulp): record wakeup causes before lp core request sleep

This commit is contained in:
hebinglin
2026-06-29 16:25:56 +08:00
parent 3a77af68b2
commit a764b5f222
18 changed files with 146 additions and 16 deletions
@@ -15,3 +15,6 @@
#define rtc_hal_ext1_get_wakeup_pins() lp_aon_ll_ext1_get_wakeup_pins()
#define lp_aon_hal_inform_wakeup_type(dslp) lp_aon_ll_inform_wakeup_type(dslp)
#define lp_aon_hal_store_wakeup_cause(wakeup_cause) lp_aon_ll_store_wakeup_cause(wakeup_cause)
#define lp_aon_hal_load_wakeup_cause() lp_aon_ll_load_wakeup_cause()
+19 -1
View File
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2023-2025 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2023-2026 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -85,6 +85,24 @@ static inline void lp_aon_ll_inform_wakeup_type(bool dslp)
}
}
/**
* @brief Set the wakeup cause stored by LP core
* @param wakeup_cause The wakeup cause in PMU register
*/
static inline void lp_aon_ll_store_wakeup_cause(uint32_t wakeup_cause)
{
REG_WRITE(RTC_LP_CORE_STORE_WAKEUP_REG, wakeup_cause);
}
/**
* @brief Get the wakeup cause stored by LP core
* @return The wakeup cause cleared before LP core sleep
*/
static inline uint32_t lp_aon_ll_load_wakeup_cause(void)
{
return REG_READ(RTC_LP_CORE_STORE_WAKEUP_REG);
}
#ifdef __cplusplus
}
#endif