aboutsummaryrefslogtreecommitdiff
path: root/examples/stm32h7/src/bin/i2c_shared.rs
diff options
context:
space:
mode:
authorjrmoulton <[email protected]>2025-06-10 15:47:54 -0600
committerjrmoulton <[email protected]>2025-06-10 15:48:36 -0600
commitcfad9798ff99d4de0571a512d156b5fe1ef1d427 (patch)
treefc3bf670f82d139de19466cddad1e909db7f3d2e /examples/stm32h7/src/bin/i2c_shared.rs
parentfc342915e6155dec7bafa3e135da7f37a9a07f5c (diff)
parent6186d111a5c150946ee5b7e9e68d987a38c1a463 (diff)
merge new embassy changes
Diffstat (limited to 'examples/stm32h7/src/bin/i2c_shared.rs')
-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 321b35a3e..ec5757284 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 {