aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/stm32h7/src/bin/i2c_shared.rs6
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};
10use embassy_stm32::mode::Async; 10use embassy_stm32::mode::Async;
11use embassy_stm32::time::Hertz; 11use embassy_stm32::time::Hertz;
12use embassy_stm32::{bind_interrupts, peripherals}; 12use embassy_stm32::{bind_interrupts, peripherals};
13use embassy_sync::blocking_mutex::raw::NoopRawMutex;
13use embassy_sync::blocking_mutex::NoopMutex; 14use embassy_sync::blocking_mutex::NoopMutex;
14use embassy_time::{Duration, Timer}; 15use embassy_time::{Duration, Timer};
16use embedded_hal_1::i2c::I2c as _;
15use static_cell::StaticCell; 17use static_cell::StaticCell;
16use {defmt_rtt as _, panic_probe as _}; 18use {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]
34async fn temperature(mut i2c: impl embedded_hal_1::i2c::I2c + 'static) { 36async 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]
51async fn humidity(mut i2c: impl embedded_hal_1::i2c::I2c + 'static) { 53async 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 {