AdaCore / Certyflie

GNU General Public License v3.0
32 stars 17 forks source link

Catch and clear UART overrun error condition. #15

Closed simonjwright closed 7 years ago

simonjwright commented 7 years ago

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.

Fabien-Chouteau commented 7 years ago

Thanks @simonjwright !

This looks good to me and it works on my Crazyflie.