Skip to content
Commit 05c45e35 authored by Thiago Silveira's avatar Thiago Silveira Committed by Carles Cufí
Browse files

drivers: serial: Fix race condition in nRF5 UART TX



Fix a somewhat rare race condition when the thread gets
preempted in the middle of sending a byte through UART.

If the other thread also sends another byte through UART
and "consumes" the EVENTS_TXDRDY value, the first thread
will get stuck in the while loop forever.

By moving the reset to the function start, we guarantee that
the baseline state of EVENTS_TXRDY is 1. Therefore, the first
thread will continue normally when it executes again.

Signed-off-by: default avatarThiago Silveira <thiago@exati.com.br>
parent cfb34d2b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment