From ad7c15c77b3c47ef18fce0979f52869e54212c59 Mon Sep 17 00:00:00 2001 From: Mieszko Mierunski Date: Mon, 19 Nov 2018 10:20:20 +0100 Subject: [PATCH] drivers: nrf: Fix nrf uarte fifo_fill function. Calling fifo_fill function from uart_nrfx_uarte in the same interrupt more than once, would break previous transmission. Following fix adds checking if previous data was sent, and if not, returns 0. Signed-off-by: Mieszko Mierunski --- drivers/serial/uart_nrfx_uarte.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/serial/uart_nrfx_uarte.c b/drivers/serial/uart_nrfx_uarte.c index 7766bd861db..25f42eea89c 100644 --- a/drivers/serial/uart_nrfx_uarte.c +++ b/drivers/serial/uart_nrfx_uarte.c @@ -275,6 +275,9 @@ static int uarte_nrfx_fifo_fill(struct device *dev, struct uarte_nrfx_data *data = get_dev_data(dev); const struct uarte_nrfx_config *config = get_dev_config(dev); + if (!nrf_uarte_event_check(uarte, NRF_UARTE_EVENT_ENDTX)) { + return 0; + } if (len > config->tx_buff_size) { len = config->tx_buff_size;