File tree Expand file tree Collapse file tree 2 files changed +5
-8
lines changed Expand file tree Collapse file tree 2 files changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -268,11 +268,11 @@ macro_rules! i2c {
268
268
self . errors += 1 ;
269
269
self . watchdog = 0 ;
270
270
// Disable I2C processing, resetting all hardware state machines
271
- self . i2c. cr1. modify( |_, w| unsafe { w. pe( ) . clear_bit( ) } ) ;
271
+ self . i2c. cr1. modify( |_, w| w. pe( ) . clear_bit( ) ) ;
272
272
// force enough wait states for the pe clear
273
273
let _ = self . i2c. cr1. read( ) ;
274
274
// Enable the I2C processing again
275
- self . i2c. cr1. modify( |_, w| unsafe { w. pe( ) . set_bit( ) } ) ;
275
+ self . i2c. cr1. modify( |_, w| w. pe( ) . set_bit( ) ) ;
276
276
} ,
277
277
_ => { self . watchdog -= 1 } ,
278
278
}
@@ -372,16 +372,12 @@ macro_rules! i2c {
372
372
return Err ( WouldBlock )
373
373
} else
374
374
if self . index == 0 {
375
- self . i2c. cr2. modify( |_, w| unsafe {
376
- w. stop( ) . set_bit( )
377
- } ) ;
375
+ self . i2c. cr2. modify( |_, w| w. stop( ) . set_bit( ) ) ;
378
376
self . errors += 1 ;
379
377
return Err ( Other ( Error :: Nack ) )
380
378
} else
381
379
{
382
- self . i2c. cr2. modify( |_, w| unsafe {
383
- w. stop( ) . set_bit( )
384
- } ) ;
380
+ self . i2c. cr2. modify( |_, w| w. stop( ) . set_bit( ) ) ;
385
381
self . errors += 1 ;
386
382
return Err ( Other ( Error :: IncorrectFrameSize ( self . index) ) )
387
383
}
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ pub use crate::dma::DmaExt as _;
24
24
pub use crate :: exti:: ExtiExt as _;
25
25
pub use crate :: flash:: FlashExt as _;
26
26
pub use crate :: gpio:: GpioExt as _;
27
+ #[ cfg( feature = "i2c-blocking" ) ]
27
28
pub use crate :: i2c:: blocking:: I2cSlave ;
28
29
pub use crate :: i2c:: I2cExt as _;
29
30
pub use crate :: power:: PowerExt as _;
You can’t perform that action at this time.
0 commit comments