diff options
| author | Thales Fragoso <[email protected]> | 2021-07-29 19:13:57 -0300 |
|---|---|---|
| committer | Thales Fragoso <[email protected]> | 2021-08-01 19:10:42 -0300 |
| commit | 64a3ebd183468c8d7bc0fd8956037894d1f3acc0 (patch) | |
| tree | 1a07a9a12525ff86d7f3b2eaf35e9f041c595b23 | |
| parent | c1bb83d29d7615e12cab6589a0e9629895fbb316 (diff) | |
i2c-v2: Use new interrupts macro
| -rw-r--r-- | embassy-stm32/src/i2c/mod.rs | 12 | ||||
| -rw-r--r-- | 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 2c42ec0e9..523a0b83a 100644 --- a/embassy-stm32/src/i2c/mod.rs +++ b/embassy-stm32/src/i2c/mod.rs | |||
| @@ -25,7 +25,7 @@ pub(crate) mod sealed { | |||
| 25 | use crate::rcc::RccPeripheral; | 25 | use crate::rcc::RccPeripheral; |
| 26 | 26 | ||
| 27 | pub trait Instance: RccPeripheral { | 27 | pub trait Instance: RccPeripheral { |
| 28 | fn regs() -> &'static crate::pac::i2c::I2c; | 28 | fn regs() -> crate::pac::i2c::I2c; |
| 29 | 29 | ||
| 30 | fn state_number() -> usize; | 30 | fn state_number() -> usize; |
| 31 | } | 31 | } |
| @@ -77,11 +77,11 @@ macro_rules! i2c_state { | |||
| 77 | }; | 77 | }; |
| 78 | } | 78 | } |
| 79 | 79 | ||
| 80 | crate::pac::peripherals!( | 80 | crate::pac::interrupts!( |
| 81 | (i2c, $inst:ident) => { | 81 | ($inst:ident, i2c, $block:ident, EV, $irq:ident) => { |
| 82 | impl sealed::Instance for peripherals::$inst { | 82 | impl sealed::Instance for peripherals::$inst { |
| 83 | fn regs() -> &'static crate::pac::i2c::I2c { | 83 | fn regs() -> crate::pac::i2c::I2c { |
| 84 | &crate::pac::$inst | 84 | crate::pac::$inst |
| 85 | } | 85 | } |
| 86 | 86 | ||
| 87 | fn state_number() -> usize { | 87 | fn state_number() -> usize { |
| @@ -90,7 +90,7 @@ crate::pac::peripherals!( | |||
| 90 | } | 90 | } |
| 91 | 91 | ||
| 92 | impl Instance for peripherals::$inst { | 92 | impl Instance for peripherals::$inst { |
| 93 | type Interrupt = crate::interrupt::$inst; | 93 | type Interrupt = crate::interrupt::$irq; |
| 94 | } | 94 | } |
| 95 | 95 | ||
| 96 | }; | 96 | }; |
diff --git a/embassy-stm32/src/i2c/v2.rs b/embassy-stm32/src/i2c/v2.rs index 8a9369557..fc4f52cf3 100644 --- a/embassy-stm32/src/i2c/v2.rs +++ b/embassy-stm32/src/i2c/v2.rs | |||
| @@ -5,7 +5,7 @@ use core::task::Poll; | |||
| 5 | use atomic_polyfill::{AtomicUsize, Ordering}; | 5 | use atomic_polyfill::{AtomicUsize, Ordering}; |
| 6 | use embassy::interrupt::InterruptExt; | 6 | use embassy::interrupt::InterruptExt; |
| 7 | use embassy::util::{AtomicWaker, OnDrop, Unborrow}; | 7 | use embassy::util::{AtomicWaker, OnDrop, Unborrow}; |
| 8 | use embassy_extras::unborrow; | 8 | use embassy_hal_common::unborrow; |
| 9 | use embedded_hal::blocking::i2c::Read; | 9 | use embedded_hal::blocking::i2c::Read; |
| 10 | use embedded_hal::blocking::i2c::Write; | 10 | use embedded_hal::blocking::i2c::Write; |
| 11 | use embedded_hal::blocking::i2c::WriteRead; | 11 | use embedded_hal::blocking::i2c::WriteRead; |
