Closed David-OConnor closed 2 years ago
Could you please show an example of new usage?
@uber-foo any opinion on this PR?
@arrowcircle here's an example of the new usage on an STM32F103:
let cp = cortex_m::Peripherals::take().unwrap();
let mut delay = Delay::new(cp.SYST, clocks);
let i2c = stm32f1xx_hal::i2c::BlockingI2c::i2c1( ... );
let mut bme280 = BME280::new_primary(i2c);
bme280.init(&mut delay).unwrap();
let measurements = bme280.measure(&mut delay).unwrap();
I've tested it on an STM32 and it's working well.
@arrowcircle here's an example of the new usage on an STM32F103:
let cp = cortex_m::Peripherals::take().unwrap(); let mut delay = Delay::new(cp.SYST, clocks); let i2c = stm32f1xx_hal::i2c::BlockingI2c::i2c1( ... ); let mut bme280 = BME280::new_primary(i2c); bme280.init(&mut delay).unwrap(); let measurements = bme280.measure(&mut delay).unwrap();
I've tested it on an STM32 and it's working well.
@sciguy16 Hey! Thanks for the answer. Does it work with the rtic?
I haven't tried it with rtic, but as long as it's got something that provides a DelayMs
Don't own delay; otherwise this crate causes compatibility issues, since delay is a popular thing to do.