Skip to content
Commit 3867a165 authored by Krzysztof Chruściński's avatar Krzysztof Chruściński Committed by Ioannis Glaropoulos
Browse files

drivers: serial: nrf_uarte: Remove counters reset from rx_enable



uart_rx_enable might be called after reception is stopped by lack
of buffers with flow control enabled. In that case there is a couple
of bytes kept in the HW FIFO. When HW TIMER is used for byte counting,
it is using RXDRDY event to count bytes. RXDRDY event is generated when
byte is received in RXD. RXD is the head of HW FIFO. When DMA ends and
ENDRX event is generated, transmitter still transmits until RTS line
goes high and transmitter reacts to it and stops transmitting. First
byte received after ENDRX lands in RXD (and generates RXDRDY event),
next by goes to RXD+1 (does not generate RXRDY event).

RXDRDY event after ENDRX is counted by the TIMER. If TIMER is reset
before restarting RX this byte is lost in the calculation. Because of
that byte counters cannot be reset before enabling RX thus move to
initialization. It applies only to HW counting but to keep it consistent
resetting was removed for both modes.

Signed-off-by: default avatarKrzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
parent fcabe3a5
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment