Skip to content

Commit cc8ebb2

Browse files
author
Jonathan Pallant (42 Technology)
committed
Clear UART overflow bit.
1 parent cb7c827 commit cc8ebb2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/serial.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,8 @@ macro_rules! hal {
326326
} else if isr.nf().bit_is_set() {
327327
nb::Error::Other(Error::Noise)
328328
} else if isr.ore().bit_is_set() {
329+
// Clear the bit
330+
unsafe { (*$USARTX::ptr()).icr.write(|w| { w.orecf().set_bit() }) };
329331
nb::Error::Other(Error::Overrun)
330332
} else if isr.rxne().bit_is_set() {
331333
// NOTE(read_volatile) see `write_volatile` below

0 commit comments

Comments
 (0)