mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Merge branch 'backport/shortened_uart_read_bytes_blocking_50' into 'release/v5.0'
fix(uart): remove unnecessary wait when sending message to ring buffer(backport5.0) See merge request espressif/esp-idf!31384
This commit is contained in:
commit
6f72d019ec
@ -1257,7 +1257,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;
|
||||
@ -1371,7 +1371,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;
|
||||
|
Loading…
Reference in New Issue
Block a user