mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 03:00:34 +03:00
Merge branch 'fix/esp_idf_p4_uart_wakeupmode0_v6.0' into 'release/v6.0'
change(example): change uart wakeup mode 0 edge threshold(v6.0) See merge request espressif/esp-idf!46374
This commit is contained in:
@@ -273,7 +273,7 @@ static void uart_wakeup_set_get_test(int uart_num)
|
||||
printf("uart wake up set and get test\n");
|
||||
int wake_up_set = 0;
|
||||
int wake_up_get = 0;
|
||||
for (int i = 3; i < 0x3ff; i++) {
|
||||
for (int i = 6; i < 0x3ff; i++) {
|
||||
wake_up_set = i;
|
||||
TEST_ESP_OK(uart_set_wakeup_threshold(uart_num, wake_up_set));
|
||||
TEST_ESP_OK(uart_get_wakeup_threshold(uart_num, &wake_up_get));
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2022-2026 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -1061,8 +1061,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_edge_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_WAKEUP_EDGE_THRED_MIN;
|
||||
// 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_WAKEUP_EDGE_THRED_MIN : UART_LL_WAKEUP_EDGE_THRED_MIN + 3;
|
||||
hw->sleep_conf2.active_threshold = wakeup_thrd - offset;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1370,7 +1372,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_edge_thrd(uart_dev_t *hw)
|
||||
{
|
||||
return hw->sleep_conf2.active_threshold + UART_LL_WAKEUP_EDGE_THRED_MIN;
|
||||
// HP UART: offset is 6, LP UART: offset is 3
|
||||
uint32_t offset = (hw == &LP_UART) ? UART_LL_WAKEUP_EDGE_THRED_MIN : UART_LL_WAKEUP_EDGE_THRED_MIN + 3;
|
||||
return hw->sleep_conf2.active_threshold + offset;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user