From 64a3ebd183468c8d7bc0fd8956037894d1f3acc0 Mon Sep 17 00:00:00 2001 From: Thales Fragoso Date: Thu, 29 Jul 2021 19:13:57 -0300 Subject: [PATCH] i2c-v2: Use new interrupts macro --- embassy-stm32/src/i2c/mod.rs | 12 ++++++------ embassy-stm32/src/i2c/v2.rs | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/embassy-stm32/src/i2c/mod.rs b/embassy-stm32/src/i2c/mod.rs index 2c42ec0e..523a0b83 100644 --- a/embassy-stm32/src/i2c/mod.rs +++ b/embassy-stm32/src/i2c/mod.rs @@ -25,7 +25,7 @@ pub(crate) mod sealed { use crate::rcc::RccPeripheral; pub trait Instance: RccPeripheral { - fn regs() -> &'static crate::pac::i2c::I2c; + fn regs() -> crate::pac::i2c::I2c; fn state_number() -> usize; } @@ -77,11 +77,11 @@ macro_rules! i2c_state { }; } -crate::pac::peripherals!( - (i2c, $inst:ident) => { +crate::pac::interrupts!( + ($inst:ident, i2c, $block:ident, EV, $irq:ident) => { impl sealed::Instance for peripherals::$inst { - fn regs() -> &'static crate::pac::i2c::I2c { - &crate::pac::$inst + fn regs() -> crate::pac::i2c::I2c { + crate::pac::$inst } fn state_number() -> usize { @@ -90,7 +90,7 @@ crate::pac::peripherals!( } impl Instance for peripherals::$inst { - type Interrupt = crate::interrupt::$inst; + type Interrupt = crate::interrupt::$irq; } }; diff --git a/embassy-stm32/src/i2c/v2.rs b/embassy-stm32/src/i2c/v2.rs index 8a936955..fc4f52cf 100644 --- a/embassy-stm32/src/i2c/v2.rs +++ b/embassy-stm32/src/i2c/v2.rs @@ -5,7 +5,7 @@ use core::task::Poll; use atomic_polyfill::{AtomicUsize, Ordering}; use embassy::interrupt::InterruptExt; use embassy::util::{AtomicWaker, OnDrop, Unborrow}; -use embassy_extras::unborrow; +use embassy_hal_common::unborrow; use embedded_hal::blocking::i2c::Read; use embedded_hal::blocking::i2c::Write; use embedded_hal::blocking::i2c::WriteRead;