From 315aa1fcd8089113c12eaaf8cff3fea8a9d7d65a Mon Sep 17 00:00:00 2001 From: Wangjialin Date: Wed, 12 Apr 2017 16:57:37 +0800 Subject: [PATCH] Fix uart tx function block issue To enable tx empty interrupt each time the tx ringbuffer get filled, so that tx function will not block if tx data length is larger than tx ringbuffer size. Reported from customer of Audio team. --- components/driver/uart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/driver/uart.c b/components/driver/uart.c index 78add6d2d0..3787e05c95 100644 --- a/components/driver/uart.c +++ b/components/driver/uart.c @@ -806,9 +806,9 @@ static int uart_tx_all(uart_port_t uart_num, const char* src, size_t size, bool xRingbufferSend(p_uart_obj[uart_num]->tx_ring_buf, (void*) (src + offset), send_size, portMAX_DELAY); size -= send_size; offset += send_size; + uart_enable_tx_intr(uart_num, 1, UART_EMPTY_THRESH_DEFAULT); } xSemaphoreGive(p_uart_obj[uart_num]->tx_mux); - uart_enable_tx_intr(uart_num, 1, UART_EMPTY_THRESH_DEFAULT); } else { while(size) { //semaphore for tx_fifo available