Skip to content

Commit

Permalink
drivers: nrf: uarte: rx flush amount calculation
Browse files Browse the repository at this point in the history
The NRF UARTE has an undocumented feature that when you flush the RX
FIFO, the RXAMOUNT register is not cleared to zero if the FIFO is in
fact empty. This fix is correcting something that was most likely a
typo.

Signed-off-by: Petri Oksanen <petri@iote.ai>
  • Loading branch information
petriok authored and carlescufi committed Mar 29, 2021
1 parent 0e39b7d commit 4c88abc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/serial/uart_nrfx_uarte.c
Original file line number Diff line number Diff line change
Expand Up @@ -1155,7 +1155,7 @@ static uint8_t rx_flush(const struct device *dev, uint8_t *buf, uint32_t len)
return rx_amount;
}

for (int i = 0; i < 0; i++) {
for (int i = 0; i < flush_len; i++) {
if (buf[i] != dirty) {
return rx_amount;
}
Expand Down

0 comments on commit 4c88abc

Please sign in to comment.