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/).
1212- Wrong default modes for debug GPIO pins
1313- Wrong calculation of HCLK prescaler, if using a prescaler value equal or
1414 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 ) )
1516
1617## [ v0.4.2] - 2020-03-21
1718
Original file line number Diff line number Diff line change @@ -319,13 +319,20 @@ macro_rules! hal {
319319 // NOTE(unsafe) atomic read with no side effects
320320 let isr = unsafe { ( * $USARTX:: ptr( ) ) . isr. read( ) } ;
321321
322+ // NOTE(unsafe, write) write accessor for atomic writes with no side effects
323+ let icr = unsafe { & ( * $USARTX:: ptr( ) ) . icr } ;
324+
322325 Err ( if isr. pe( ) . bit_is_set( ) {
326+ icr. write( |w| w. pecf( ) . clear( ) ) ;
323327 nb:: Error :: Other ( Error :: Parity )
324328 } else if isr. fe( ) . bit_is_set( ) {
329+ icr. write( |w| w. fecf( ) . clear( ) ) ;
325330 nb:: Error :: Other ( Error :: Framing )
326331 } else if isr. nf( ) . bit_is_set( ) {
332+ icr. write( |w| w. ncf( ) . clear( ) ) ;
327333 nb:: Error :: Other ( Error :: Noise )
328334 } else if isr. ore( ) . bit_is_set( ) {
335+ icr. write( |w| w. orecf( ) . clear( ) ) ;
329336 nb:: Error :: Other ( Error :: Overrun )
330337 } else if isr. rxne( ) . bit_is_set( ) {
331338 // NOTE(read_volatile) see `write_volatile` below
You can’t perform that action at this time.
0 commit comments