mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-01 18:50:34 +03:00
Merge branch 'bugfix/esp_idf_ulp_wakeupcauses_record_v6.0' into 'release/v6.0'
fix(ulp): record wakeup causes before lp core request sleep v6.0 See merge request espressif/esp-idf!49142
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
|
||||
|
||||
@@ -13,6 +13,8 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
#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()
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2023-2024 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, (REG_READ(RTC_LP_CORE_STORE_WAKEUP_REG) & 0x1) | ((wakeup_cause << 1) & 0xFFFFFFFE));
|
||||
}
|
||||
|
||||
/**
|
||||
* @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) & 0xFFFFFFFE) >> 1;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user