summaryrefslogtreecommitdiff
path: root/examples/stm32l4/src/bin/i2c.rs
diff options
context:
space:
mode:
Diffstat (limited to 'examples/stm32l4/src/bin/i2c.rs')
-rw-r--r--examples/stm32l4/src/bin/i2c.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/examples/stm32l4/src/bin/i2c.rs b/examples/stm32l4/src/bin/i2c.rs
index 5bfa560d..177f6baf 100644
--- a/examples/stm32l4/src/bin/i2c.rs
+++ b/examples/stm32l4/src/bin/i2c.rs
@@ -6,15 +6,16 @@ use defmt::*;
use embassy_executor::executor::Spawner;
use embassy_stm32::dma::NoDma;
use embassy_stm32::i2c::I2c;
+use embassy_stm32::interrupt;
use embassy_stm32::time::Hertz;
-use embassy_stm32::{interrupt, Peripherals};
use {defmt_rtt as _, panic_probe as _};
const ADDRESS: u8 = 0x5F;
const WHOAMI: u8 = 0x0F;
#[embassy_executor::main]
-async fn main(_spawner: Spawner, p: Peripherals) -> ! {
+async fn main(_spawner: Spawner) -> ! {
+ let p = embassy_stm32::init(Default::default());
let irq = interrupt::take!(I2C2_EV);
let mut i2c = I2c::new(
p.I2C2,