From 6cb9199dfc088ae36e57322fe2e4dfd785fb522c Mon Sep 17 00:00:00 2001 From: Krzysztof Chruscinski Date: Thu, 4 Jun 2020 12:36:37 +0200 Subject: [PATCH] drivers: uart: nrf_uart: Generate RX_RDY after rx_disable So far, when rx_disable was called then received data was discarded. This is currently not according to the API but it is needed if rx_disabled is called due to out of band information about end of packet. Signed-off-by: Krzysztof Chruscinski --- drivers/serial/uart_nrfx_uart.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/serial/uart_nrfx_uart.c b/drivers/serial/uart_nrfx_uart.c index b9eb254ed76..30e5a09ae11 100644 --- a/drivers/serial/uart_nrfx_uart.c +++ b/drivers/serial/uart_nrfx_uart.c @@ -693,6 +693,11 @@ static void rxto_isr(void) { nrf_uart_event_clear(uart0_addr, NRF_UART_EVENT_RXTO); + /* Send rxrdy if there is any data pending. */ + if (uart0_cb.rx_counter - uart0_cb.rx_offset) { + rx_rdy_evt(); + } + buf_released_evt(); if (uart0_cb.rx_secondary_buffer_length) { uart0_cb.rx_buffer = uart0_cb.rx_secondary_buffer;