Merge branch 'change/esp_idf_uart_wakeup_refactor_v5.3' into 'release/v5.3'

change(example): change uart wakeup mode 0 edge threshold (v5.3)

See merge request espressif/esp-idf!46378
This commit is contained in:
Jiang Jiang Jian
2026-03-24 21:03:41 +08:00
3 changed files with 12 additions and 7 deletions
+8 -4
View File
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2022-2026 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -1004,8 +1004,10 @@ FORCE_INLINE_ATTR void uart_ll_set_dtr_active_level(uart_dev_t *hw, int level)
*/
FORCE_INLINE_ATTR void uart_ll_set_wakeup_thrd(uart_dev_t *hw, uint32_t wakeup_thrd)
{
// System would wakeup when the number of positive edges of RxD signal is larger than or equal to (UART_ACTIVE_THRESHOLD+3)
hw->sleep_conf2.active_threshold = wakeup_thrd - UART_LL_MIN_WAKEUP_THRESH;
// System would wakeup when the number of positive edges of RxD signal is larger than or equal to (UART_ACTIVE_THRESHOLD+offset)
// HP UART: offset is 6, LP UART: offset is 3
uint32_t offset = (hw == &LP_UART) ? UART_LL_MIN_WAKEUP_THRESH : UART_LL_MIN_WAKEUP_THRESH + 3;
hw->sleep_conf2.active_threshold = wakeup_thrd - offset;
}
/**
@@ -1183,7 +1185,9 @@ FORCE_INLINE_ATTR void uart_ll_get_at_cmd_char(uart_dev_t *hw, uint8_t *cmd_char
*/
FORCE_INLINE_ATTR uint32_t uart_ll_get_wakeup_thrd(uart_dev_t *hw)
{
return hw->sleep_conf2.active_threshold + UART_LL_MIN_WAKEUP_THRESH;
// HP UART: offset is 6, LP UART: offset is 3
uint32_t offset = (hw == &LP_UART) ? UART_LL_MIN_WAKEUP_THRESH : UART_LL_MIN_WAKEUP_THRESH + 3;
return hw->sleep_conf2.active_threshold + offset;
}
/**