I implemented UART communication as follows, but occasionally the same data is sent twice.
- Enter the critical region (app_util_critical_region_enter).
- Store the transmission data in the TX FIFO until it is full (app_uart_put).
- Exit the critical region (app_util_critical_region_exit).
- When the APP_UART_TX_EMPTY event occurs, if there is any remaining transmission data, store it in the TX FIFO (app_uart_put). (If there is no remaining data, the transmission ends.)
I intend to stop the event occurrence between steps 1 and 3, but in reality, it seems that the event in step 4 is running during the process in step 2, causing the same data to be stored in the TX FIFO.
In the above design, is it not possible to stop the event occurrence?
SDK:nRF5 SDK 15.3.0
SoftDevice:s132_nrf52_6.1.1