File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
12
12
- Wrong default modes for debug GPIO pins
13
13
- Wrong calculation of HCLK prescaler, if using a prescaler value equal or
14
14
higher than 64 ([ #42 ] ( https://github.com/stm32-rs/stm32f3xx-hal/pull/42 ) )
15
+ - UART reception error flags not cleared ([ #91 ] ( https://github.com/stm32-rs/stm32f3xx-hal/pull/91 ) )
15
16
16
17
## [ v0.4.2] - 2020-03-21
17
18
Original file line number Diff line number Diff line change @@ -319,13 +319,20 @@ macro_rules! hal {
319
319
// NOTE(unsafe) atomic read with no side effects
320
320
let isr = unsafe { ( * $USARTX:: ptr( ) ) . isr. read( ) } ;
321
321
322
+ // NOTE(unsafe, write) write accessor for atomic writes with no side effects
323
+ let icr = unsafe { & ( * $USARTX:: ptr( ) ) . icr } ;
324
+
322
325
Err ( if isr. pe( ) . bit_is_set( ) {
326
+ icr. write( |w| w. pecf( ) . clear( ) ) ;
323
327
nb:: Error :: Other ( Error :: Parity )
324
328
} else if isr. fe( ) . bit_is_set( ) {
329
+ icr. write( |w| w. fecf( ) . clear( ) ) ;
325
330
nb:: Error :: Other ( Error :: Framing )
326
331
} else if isr. nf( ) . bit_is_set( ) {
332
+ icr. write( |w| w. ncf( ) . clear( ) ) ;
327
333
nb:: Error :: Other ( Error :: Noise )
328
334
} else if isr. ore( ) . bit_is_set( ) {
335
+ icr. write( |w| w. orecf( ) . clear( ) ) ;
329
336
nb:: Error :: Other ( Error :: Overrun )
330
337
} else if isr. rxne( ) . bit_is_set( ) {
331
338
// NOTE(read_volatile) see `write_volatile` below
You can’t perform that action at this time.
0 commit comments