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 <mieszko.mierunski@nordicsemi.no>
This commit is contained in:
Mieszko Mierunski 2018-11-19 10:20:20 +01:00 committed by Carles Cufí
commit ad7c15c77b

View file

@ -275,6 +275,9 @@ static int uarte_nrfx_fifo_fill(struct device *dev,
struct uarte_nrfx_data *data = get_dev_data(dev); struct uarte_nrfx_data *data = get_dev_data(dev);
const struct uarte_nrfx_config *config = get_dev_config(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) { if (len > config->tx_buff_size) {
len = config->tx_buff_size; len = config->tx_buff_size;