mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 03:00:34 +03:00
fix(ulp): record wakeup causes before lp core request sleep
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user