forked from espressif/esp-idf
fix(esp_hw_support): warning instead of error when enabling uart/gpio wakeup in pd_top sleep
This commit is contained in:
@@ -481,7 +481,6 @@ esp_err_t esp_deep_sleep_enable_gpio_wakeup(uint64_t gpio_pin_mask, esp_deepslee
|
|||||||
* @return
|
* @return
|
||||||
* - ESP_OK on success
|
* - ESP_OK on success
|
||||||
* - ESP_ERR_INVALID_STATE if wakeup triggers conflict
|
* - ESP_ERR_INVALID_STATE if wakeup triggers conflict
|
||||||
* - ESP_ERR_NOT_SUPPORTED if GPIO wakeup source is not available
|
|
||||||
*/
|
*/
|
||||||
esp_err_t esp_sleep_enable_gpio_wakeup(void);
|
esp_err_t esp_sleep_enable_gpio_wakeup(void);
|
||||||
|
|
||||||
@@ -501,7 +500,6 @@ esp_err_t esp_sleep_enable_gpio_wakeup(void);
|
|||||||
* @return
|
* @return
|
||||||
* - ESP_OK on success
|
* - ESP_OK on success
|
||||||
* - ESP_ERR_INVALID_ARG if wakeup from given UART is not supported
|
* - ESP_ERR_INVALID_ARG if wakeup from given UART is not supported
|
||||||
* - ESP_ERR_NOT_SUPPORTED if UART wakeup source is not available
|
|
||||||
*/
|
*/
|
||||||
esp_err_t esp_sleep_enable_uart_wakeup(int uart_num);
|
esp_err_t esp_sleep_enable_uart_wakeup(int uart_num);
|
||||||
|
|
||||||
|
@@ -2056,8 +2056,7 @@ esp_err_t esp_deep_sleep_enable_gpio_wakeup(uint64_t gpio_pin_mask, esp_deepslee
|
|||||||
esp_err_t esp_sleep_enable_gpio_wakeup(void)
|
esp_err_t esp_sleep_enable_gpio_wakeup(void)
|
||||||
{
|
{
|
||||||
#if CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP
|
#if CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP
|
||||||
ESP_LOGE(TAG, "%s wakeup source is not available if the peripheral power domain is powered down in sleep", "GPIO");
|
ESP_LOGW(TAG, "%s wakeup source is not available if the peripheral power domain is powered down in sleep", "GPIO");
|
||||||
return ESP_ERR_NOT_SUPPORTED;
|
|
||||||
#endif
|
#endif
|
||||||
#if CONFIG_IDF_TARGET_ESP32
|
#if CONFIG_IDF_TARGET_ESP32
|
||||||
if (s_config.wakeup_triggers & (RTC_TOUCH_TRIG_EN | RTC_ULP_TRIG_EN)) {
|
if (s_config.wakeup_triggers & (RTC_TOUCH_TRIG_EN | RTC_ULP_TRIG_EN)) {
|
||||||
@@ -2072,8 +2071,7 @@ esp_err_t esp_sleep_enable_gpio_wakeup(void)
|
|||||||
esp_err_t esp_sleep_enable_uart_wakeup(int uart_num)
|
esp_err_t esp_sleep_enable_uart_wakeup(int uart_num)
|
||||||
{
|
{
|
||||||
#if CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP
|
#if CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP
|
||||||
ESP_LOGE(TAG, "%s wakeup source is not available if the peripheral power domain is powered down in sleep", "UART");
|
ESP_LOGW(TAG, "%s wakeup source is not available if the peripheral power domain is powered down in sleep", "UART");
|
||||||
return ESP_ERR_NOT_SUPPORTED;
|
|
||||||
#endif
|
#endif
|
||||||
if (uart_num == UART_NUM_0) {
|
if (uart_num == UART_NUM_0) {
|
||||||
s_config.wakeup_triggers |= RTC_UART0_TRIG_EN;
|
s_config.wakeup_triggers |= RTC_UART0_TRIG_EN;
|
||||||
|
@@ -146,7 +146,7 @@ menu "Power Management"
|
|||||||
select PM_POWER_DOWN_CPU_IN_LIGHT_SLEEP if !SOC_CPU_IN_TOP_DOMAIN
|
select PM_POWER_DOWN_CPU_IN_LIGHT_SLEEP if !SOC_CPU_IN_TOP_DOMAIN
|
||||||
default n #TODO: enable by default if periph init/deinit management supported (WIFI-5252)
|
default n #TODO: enable by default if periph init/deinit management supported (WIFI-5252)
|
||||||
help
|
help
|
||||||
If enabled, digital peripherals will be powered down in light sleep, all related peripherals will
|
If enabled, digital peripherals will try to powered down in light sleep, then all related peripherals will
|
||||||
not be available during sleep, including wake-up sources from the peripherals (For detailed availability
|
not be available during sleep, including wake-up sources from the peripherals (For detailed availability
|
||||||
information, see the note of the corresponding wakeup source enable function).
|
information, see the note of the corresponding wakeup source enable function).
|
||||||
The chip will automatically save/restore register context during sleep/wakeup to make the upper layer
|
The chip will automatically save/restore register context during sleep/wakeup to make the upper layer
|
||||||
@@ -171,6 +171,14 @@ menu "Power Management"
|
|||||||
of freertos to not be compensated correctly when returning from sleep and cause the system to crash.
|
of freertos to not be compensated correctly when returning from sleep and cause the system to crash.
|
||||||
To avoid this, you can increase FREERTOS_IDLE_TIME_BEFORE_SLEEP threshold in menuconfig.
|
To avoid this, you can increase FREERTOS_IDLE_TIME_BEFORE_SLEEP threshold in menuconfig.
|
||||||
|
|
||||||
|
Note3: Enabling this option does not necessarily mean that the peripheral power domain will be
|
||||||
|
turned down during sleep. The control priority of `esp_sleep_pd_config` is higher than this option,
|
||||||
|
user code can still prevent the peripheral power domain from powering down during sleep by
|
||||||
|
`esp_sleep_pd_config(ESP_PD_DOMAIN_TOP, ESP_PD_OPTION_ON)`. In addition, whether the peripheral power
|
||||||
|
domain is powered down during sleep also depends on the sleep working strategy selected by the driver.
|
||||||
|
If any module belonging to the peripheral power domain chooses not to be powered down during sleep,
|
||||||
|
then the peripheral power domain will not be powered off either.
|
||||||
|
|
||||||
config PM_UPDATE_CCOMPARE_HLI_WORKAROUND
|
config PM_UPDATE_CCOMPARE_HLI_WORKAROUND
|
||||||
bool
|
bool
|
||||||
default y if PM_ENABLE && BTDM_CTRL_HLI
|
default y if PM_ENABLE && BTDM_CTRL_HLI
|
||||||
|
Reference in New Issue
Block a user