mirror of
https://github.com/espressif/esp-idf.git
synced 2026-04-27 19:13:21 +00:00
Merge branch 'fix/ungate_uart_pad_when_set_sleep_wakeup' into 'master'
fix(esp_driver_uart): enable pad sleep clock in uart_wakeup_setup function Closes PM-664 and IDFCI-7519 See merge request espressif/esp-idf!45771
This commit is contained in:
@@ -2275,9 +2275,6 @@ esp_err_t uart_set_wakeup_threshold(uart_port_t uart_num, int wakeup_threshold)
|
||||
"wakeup_threshold out of bounds");
|
||||
UART_ENTER_CRITICAL(&(uart_context[uart_num].spinlock));
|
||||
uart_hal_set_wakeup_edge_thrd(&(uart_context[uart_num].hal), wakeup_threshold);
|
||||
PERIPH_RCC_ATOMIC() {
|
||||
uart_ll_enable_pad_sleep_clock(uart_context[uart_num].hal.dev, true);
|
||||
}
|
||||
UART_EXIT_CRITICAL(&(uart_context[uart_num].spinlock));
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2024-2026 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -15,6 +15,7 @@
|
||||
#include "driver/uart_wakeup.h"
|
||||
#include "hal/uart_hal.h"
|
||||
#include "esp_private/esp_sleep_internal.h"
|
||||
#include "esp_private/periph_ctrl.h"
|
||||
#include "esp_log.h"
|
||||
|
||||
#if (SOC_UART_LP_NUM >= 1)
|
||||
@@ -71,7 +72,9 @@ esp_err_t uart_wakeup_setup(uart_port_t uart_num, const uart_wakeup_cfg_t *cfg)
|
||||
|
||||
// This should be mocked at ll level if the selection of the UART wakeup mode is not supported by this SOC.
|
||||
uart_ll_set_wakeup_mode(hw, cfg->wakeup_mode);
|
||||
|
||||
PERIPH_RCC_ATOMIC() {
|
||||
uart_ll_enable_pad_sleep_clock(hw, true);
|
||||
}
|
||||
// When uarts are utilized, the src clk(hp_uart: main XTAL, lp_uart: RTC_FAST or XTAL_D2) need to be PU and ungate,and for hp uart UARTx & IOMX ICG need to be ungate
|
||||
if (cfg->wakeup_mode != UART_WK_MODE_ACTIVE_THRESH) {
|
||||
if (uart_num < SOC_UART_HP_NUM) {
|
||||
|
||||
Reference in New Issue
Block a user