File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -320,13 +320,19 @@ macro_rules! hal {
320
320
let isr = unsafe { ( * $USARTX:: ptr( ) ) . isr. read( ) } ;
321
321
322
322
Err ( if isr. pe( ) . bit_is_set( ) {
323
+ // Clear the bit by writing 1 to the clear register
324
+ unsafe { ( * $USARTX:: ptr( ) ) . icr. write( |w| { w. pecf( ) . set_bit( ) } ) } ;
323
325
nb:: Error :: Other ( Error :: Parity )
324
326
} else if isr. fe( ) . bit_is_set( ) {
327
+ // Clear the bit by writing 1 to the clear register
328
+ unsafe { ( * $USARTX:: ptr( ) ) . icr. write( |w| { w. fecf( ) . set_bit( ) } ) } ;
325
329
nb:: Error :: Other ( Error :: Framing )
326
330
} else if isr. nf( ) . bit_is_set( ) {
331
+ // Clear the bit by writing 1 to the clear register
332
+ unsafe { ( * $USARTX:: ptr( ) ) . icr. write( |w| { w. ncf( ) . set_bit( ) } ) } ;
327
333
nb:: Error :: Other ( Error :: Noise )
328
334
} else if isr. ore( ) . bit_is_set( ) {
329
- // Clear the bit
335
+ // Clear the bit by writing 1 to the clear register
330
336
unsafe { ( * $USARTX:: ptr( ) ) . icr. write( |w| { w. orecf( ) . set_bit( ) } ) } ;
331
337
nb:: Error :: Other ( Error :: Overrun )
332
338
} else if isr. rxne( ) . bit_is_set( ) {
You can’t perform that action at this time.
0 commit comments