Skip to content

Commit

Permalink
Merge branch 'backport/shortened_uart_read_bytes_blocking_52' into 'r…
Browse files Browse the repository at this point in the history
…elease/v5.2'

fix(uart): remove unnecessary wait when sending message to ring buffer(backport5.2)

See merge request espressif/esp-idf!31381
  • Loading branch information
ginkgm committed Jun 13, 2024
2 parents e5ffb3c + e69714c commit e95cea5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/driver/uart/uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit e95cea5

Please # to comment.