From 6a21403cba148627e6a570839423d0a510efab81 Mon Sep 17 00:00:00 2001 From: Bradley McFadden <43303608+bradley-mcfadden@users.noreply.github.com> Date: Mon, 27 Feb 2023 16:28:00 -0500 Subject: [PATCH] uart: Correct typo in referenced function name The functions `uart_enable_pattern_det_intr` have been renamed to `uart_enable_pattern_det_baud_intr`, but a reference to these functions in the programming guide was not updated. Merges https://github.com/espressif/esp-idf/pull/10856 --- components/driver/uart/uart.c | 22 ------------------- docs/en/api-reference/peripherals/uart.rst | 2 +- docs/zh_CN/api-reference/peripherals/uart.rst | 2 +- 3 files changed, 2 insertions(+), 24 deletions(-) diff --git a/components/driver/uart/uart.c b/components/driver/uart/uart.c index 70d71813b1ea..140bfe469836 100644 --- a/components/driver/uart/uart.c +++ b/components/driver/uart/uart.c @@ -512,28 +512,6 @@ esp_err_t uart_pattern_queue_reset(uart_port_t uart_num, int queue_length) return ESP_OK; } -#if CONFIG_IDF_TARGET_ESP32 -esp_err_t uart_enable_pattern_det_intr(uart_port_t uart_num, char pattern_chr, uint8_t chr_num, int chr_tout, int post_idle, int pre_idle) -{ - ESP_RETURN_ON_FALSE((uart_num < UART_NUM_MAX), ESP_FAIL, UART_TAG, "uart_num error"); - ESP_RETURN_ON_FALSE(chr_tout >= 0 && chr_tout <= UART_RX_GAP_TOUT_V, ESP_FAIL, UART_TAG, "uart pattern set error\n"); - ESP_RETURN_ON_FALSE(post_idle >= 0 && post_idle <= UART_POST_IDLE_NUM_V, ESP_FAIL, UART_TAG, "uart pattern set error\n"); - ESP_RETURN_ON_FALSE(pre_idle >= 0 && pre_idle <= UART_PRE_IDLE_NUM_V, ESP_FAIL, UART_TAG, "uart pattern set error\n"); - uart_at_cmd_t at_cmd = {0}; - at_cmd.cmd_char = pattern_chr; - at_cmd.char_num = chr_num; - at_cmd.gap_tout = chr_tout; - at_cmd.pre_idle = pre_idle; - at_cmd.post_idle = post_idle; - uart_hal_clr_intsts_mask(&(uart_context[uart_num].hal), UART_INTR_CMD_CHAR_DET); - UART_ENTER_CRITICAL(&(uart_context[uart_num].spinlock)); - uart_hal_set_at_cmd_char(&(uart_context[uart_num].hal), &at_cmd); - uart_hal_ena_intr_mask(&(uart_context[uart_num].hal), UART_INTR_CMD_CHAR_DET); - UART_EXIT_CRITICAL(&(uart_context[uart_num].spinlock)); - return ESP_OK; -} -#endif - esp_err_t uart_enable_pattern_det_baud_intr(uart_port_t uart_num, char pattern_chr, uint8_t chr_num, int chr_tout, int post_idle, int pre_idle) { ESP_RETURN_ON_FALSE(uart_num < UART_NUM_MAX, ESP_FAIL, UART_TAG, "uart_num error"); diff --git a/docs/en/api-reference/peripherals/uart.rst b/docs/en/api-reference/peripherals/uart.rst index 1cbbf627c00d..f5b8c97f2648 100644 --- a/docs/en/api-reference/peripherals/uart.rst +++ b/docs/en/api-reference/peripherals/uart.rst @@ -233,7 +233,7 @@ The API provides a convenient way to handle specific interrupts discussed in thi - **Pattern detection**: An interrupt triggered on detecting a 'pattern' of the same character being received/sent repeatedly. This functionality is demonstrated in the example :example:`peripherals/uart/uart_events`. It can be used, e.g., to detect a command string with a specific number of identical characters (the 'pattern') at the end. The following functions are available: - - Configure and enable this interrupt using :cpp:func:`uart_enable_pattern_det_intr` + - Configure and enable this interrupt using :cpp:func:`uart_enable_pattern_det_baud_intr` - Disable the interrupt using :cpp:func:`uart_disable_pattern_det_intr` diff --git a/docs/zh_CN/api-reference/peripherals/uart.rst b/docs/zh_CN/api-reference/peripherals/uart.rst index fde061a67c78..c8e214eebb46 100644 --- a/docs/zh_CN/api-reference/peripherals/uart.rst +++ b/docs/zh_CN/api-reference/peripherals/uart.rst @@ -233,7 +233,7 @@ API 提供了一种便利的方法来处理本文所讨论的特定中断,即 - **模式检测**:在检测到重复接收/发送同一字符的“模式”时触发中断,请参考示例 :example:`peripherals/uart/uart_events`。例如,模式检测可用于检测命令字符串末尾是否存在特定数量的相同字符(“模式”)。可以调用以下函数: - - 配置并启用此中断:调用 :cpp:func:`uart_enable_pattern_det_intr` + - 配置并启用此中断:调用 :cpp:func:`uart_enable_pattern_det_baud_intr` - 禁用中断:调用 :cpp:func:`uart_disable_pattern_det_intr`