Rewrite to have the IRQ handler read the character and place it in a FreeRTOS queue.
Was seeing odd RX errors with the prior driver, an occasional old character inserted. It only affected one particular device so might have been timing critical. Could not spot the problem, but toggling the interrupt enable outside the interrupt handler looked like trouble, so rewrote this to avoid that. This proposed rewrite reads the character from the fifo within the interrupt handler, and uses a FreeRTOS queue to queue them, and it also enables some RX error checking (parity, framing, breaks) and simple counters for these.
Rewrite to have the IRQ handler read the character and place it in a FreeRTOS queue.
Was seeing odd RX errors with the prior driver, an occasional old character inserted. It only affected one particular device so might have been timing critical. Could not spot the problem, but toggling the interrupt enable outside the interrupt handler looked like trouble, so rewrote this to avoid that. This proposed rewrite reads the character from the fifo within the interrupt handler, and uses a FreeRTOS queue to queue them, and it also enables some RX error checking (parity, framing, breaks) and simple counters for these.