how to empty UART FIFO
Hi, I'm using the UART on a STM32G071 MCU. To read data get an interrupt when the FIFO reach the FIFO reaches the threshold of 1/2.
Inside the interrupt routine I check if there are uart errors.
If I get some errors I want to discard data received. Before quit from the interrupt routine I want to empty the FIFO reading all the bytes received. I didn't find any bit on UART registers that indicate that FIFO si completely empty. Can you help me? Is there any other way to get the FIFO empty?
