diff options
Diffstat (limited to 'examples/stm32h7')
| -rw-r--r-- | examples/stm32h7/src/bin/i2c_shared.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/examples/stm32h7/src/bin/i2c_shared.rs b/examples/stm32h7/src/bin/i2c_shared.rs index 6f4815582..136b91eeb 100644 --- a/examples/stm32h7/src/bin/i2c_shared.rs +++ b/examples/stm32h7/src/bin/i2c_shared.rs | |||
| @@ -10,8 +10,10 @@ use embassy_stm32::i2c::{self, I2c}; | |||
| 10 | use embassy_stm32::mode::Async; | 10 | use embassy_stm32::mode::Async; |
| 11 | use embassy_stm32::time::Hertz; | 11 | use embassy_stm32::time::Hertz; |
| 12 | use embassy_stm32::{bind_interrupts, peripherals}; | 12 | use embassy_stm32::{bind_interrupts, peripherals}; |
| 13 | use embassy_sync::blocking_mutex::raw::NoopRawMutex; | ||
| 13 | use embassy_sync::blocking_mutex::NoopMutex; | 14 | use embassy_sync::blocking_mutex::NoopMutex; |
| 14 | use embassy_time::{Duration, Timer}; | 15 | use embassy_time::{Duration, Timer}; |
| 16 | use embedded_hal_1::i2c::I2c as _; | ||
| 15 | use static_cell::StaticCell; | 17 | use static_cell::StaticCell; |
| 16 | use {defmt_rtt as _, panic_probe as _}; | 18 | use {defmt_rtt as _, panic_probe as _}; |
| 17 | 19 | ||
| @@ -31,7 +33,7 @@ bind_interrupts!(struct Irqs { | |||
| 31 | }); | 33 | }); |
| 32 | 34 | ||
| 33 | #[embassy_executor::task] | 35 | #[embassy_executor::task] |
| 34 | async fn temperature(mut i2c: impl embedded_hal_1::i2c::I2c + 'static) { | 36 | async fn temperature(mut i2c: I2cDevice<'static, NoopRawMutex, I2c<'static, Async>>) { |
| 35 | let mut data = [0u8; 2]; | 37 | let mut data = [0u8; 2]; |
| 36 | 38 | ||
| 37 | loop { | 39 | loop { |
| @@ -48,7 +50,7 @@ async fn temperature(mut i2c: impl embedded_hal_1::i2c::I2c + 'static) { | |||
| 48 | } | 50 | } |
| 49 | 51 | ||
| 50 | #[embassy_executor::task] | 52 | #[embassy_executor::task] |
| 51 | async fn humidity(mut i2c: impl embedded_hal_1::i2c::I2c + 'static) { | 53 | async fn humidity(mut i2c: I2cDevice<'static, NoopRawMutex, I2c<'static, Async>>) { |
| 52 | let mut data = [0u8; 6]; | 54 | let mut data = [0u8; 6]; |
| 53 | 55 | ||
| 54 | loop { | 56 | loop { |
