i2c-v2: Use new interrupts macro
This commit is contained in:
parent
c1bb83d29d
commit
64a3ebd183
@ -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;
|
||||
}
|
||||
|
||||
};
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user