This differs from the patch in issue #6, because I realised that we only get to the overrun case if there wasn’t a character in the data register to read; so just read & discard.
I called Clear_Status, because that’s what the original code did, but I’m not at all sure that’s necessary. The RM says the overflow status is cleared by reading SR, DR.
This differs from the patch in issue #6, because I realised that we only get to the overrun case if there wasn’t a character in the data register to read; so just read & discard.
I called
Clear_Status
, because that’s what the original code did, but I’m not at all sure that’s necessary. The RM says the overflow status is cleared by reading SR, DR.Similar comment for RXNE, I think.