From e69714c34f0865096fe12a0512183b304c196906 Mon Sep 17 00:00:00 2001 From: zwx Date: Fri, 7 Jun 2024 11:42:35 +0800 Subject: [PATCH] fix(uart): remove unnecessary wait when sending message to ring buffer --- components/driver/uart/uart.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/driver/uart/uart.c b/components/driver/uart/uart.c index 17a452d9d4..3dd17453e5 100644 --- a/components/driver/uart/uart.c +++ b/components/driver/uart/uart.c @@ -1376,7 +1376,7 @@ int uart_write_bytes_with_break(uart_port_t uart_num, const void *src, size_t si static bool uart_check_buf_full(uart_port_t uart_num) { if (p_uart_obj[uart_num]->rx_buffer_full_flg) { - BaseType_t res = xRingbufferSend(p_uart_obj[uart_num]->rx_ring_buf, p_uart_obj[uart_num]->rx_data_buf, p_uart_obj[uart_num]->rx_stash_len, 1); + BaseType_t res = xRingbufferSend(p_uart_obj[uart_num]->rx_ring_buf, p_uart_obj[uart_num]->rx_data_buf, p_uart_obj[uart_num]->rx_stash_len, 0); if (res == pdTRUE) { UART_ENTER_CRITICAL(&(uart_context[uart_num].spinlock)); p_uart_obj[uart_num]->rx_buffered_len += p_uart_obj[uart_num]->rx_stash_len; @@ -1490,7 +1490,7 @@ esp_err_t uart_flush_input(uart_port_t uart_num) UART_EXIT_CRITICAL(&(uart_context[uart_num].spinlock)); vRingbufferReturnItem(p_uart->rx_ring_buf, data); if (p_uart_obj[uart_num]->rx_buffer_full_flg) { - BaseType_t res = xRingbufferSend(p_uart_obj[uart_num]->rx_ring_buf, p_uart_obj[uart_num]->rx_data_buf, p_uart_obj[uart_num]->rx_stash_len, 1); + BaseType_t res = xRingbufferSend(p_uart_obj[uart_num]->rx_ring_buf, p_uart_obj[uart_num]->rx_data_buf, p_uart_obj[uart_num]->rx_stash_len, 0); if (res == pdTRUE) { UART_ENTER_CRITICAL(&(uart_context[uart_num].spinlock)); p_uart_obj[uart_num]->rx_buffered_len += p_uart_obj[uart_num]->rx_stash_len;