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

This commit is contained in:
hebinglin
2026-04-22 16:22:11 +08:00
parent c225eb59db
commit 0603e0eb23
23 changed files with 173 additions and 16 deletions
@@ -13,6 +13,8 @@ extern "C" {
#endif
#define lp_aon_hal_inform_wakeup_type(dslp) lp_sys_ll_inform_wakeup_type(dslp)
#define lp_aon_hal_store_wakeup_cause(wakeup_cause) lp_sys_ll_store_wakeup_cause(wakeup_cause)
#define lp_aon_hal_load_wakeup_cause() lp_sys_ll_load_wakeup_cause()
#ifdef __cplusplus
}
+20 -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
*/
@@ -81,6 +81,25 @@ FORCE_INLINE_ATTR void lp_sys_ll_set_lp_mem_lowpower_mode(uint32_t mode)
LP_SYS.lp_mem_aux_ctrl.lp_mem_lowpower_mode = mode;
}
#endif
/**
* @brief Set the wakeup cause stored by LP core
* @param wakeup_cause The wakeup cause in PMU register
*/
static inline void lp_sys_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_sys_ll_load_wakeup_cause(void)
{
return REG_READ(RTC_LP_CORE_STORE_WAKEUP_REG);
}
#ifdef __cplusplus
}
#endif