diff options
| author | goueslati <[email protected]> | 2023-06-12 14:27:53 +0100 |
|---|---|---|
| committer | goueslati <[email protected]> | 2023-06-12 14:27:53 +0100 |
| commit | 2d89cfb18f00aefbfa108728dfea3398e80ea3e4 (patch) | |
| tree | 6485dacac7e61c4378ac522e709edb0a86bd7523 /embassy-stm32/src/i2c | |
| parent | 2dd5ce83ec0421564e85b667f5dabd592f313e5c (diff) | |
| parent | ab86b060500ceda1c80e39f35af69cb08a7b63a2 (diff) | |
fix merge conflict
Diffstat (limited to 'embassy-stm32/src/i2c')
| -rw-r--r-- | embassy-stm32/src/i2c/mod.rs | 6 | ||||
| -rw-r--r-- | embassy-stm32/src/i2c/v1.rs | 4 | ||||
| -rw-r--r-- | embassy-stm32/src/i2c/v2.rs | 6 |
3 files changed, 8 insertions, 8 deletions
diff --git a/embassy-stm32/src/i2c/mod.rs b/embassy-stm32/src/i2c/mod.rs index f898fcc8b..b35678ed9 100644 --- a/embassy-stm32/src/i2c/mod.rs +++ b/embassy-stm32/src/i2c/mod.rs | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | #![macro_use] | 1 | #![macro_use] |
| 2 | 2 | ||
| 3 | use crate::interrupt::Interrupt; | 3 | use crate::interrupt; |
| 4 | 4 | ||
| 5 | #[cfg_attr(i2c_v1, path = "v1.rs")] | 5 | #[cfg_attr(i2c_v1, path = "v1.rs")] |
| 6 | #[cfg_attr(i2c_v2, path = "v2.rs")] | 6 | #[cfg_attr(i2c_v2, path = "v2.rs")] |
| @@ -35,7 +35,7 @@ pub(crate) mod sealed { | |||
| 35 | } | 35 | } |
| 36 | 36 | ||
| 37 | pub trait Instance: sealed::Instance + 'static { | 37 | pub trait Instance: sealed::Instance + 'static { |
| 38 | type Interrupt: Interrupt; | 38 | type Interrupt: interrupt::typelevel::Interrupt; |
| 39 | } | 39 | } |
| 40 | 40 | ||
| 41 | pin_trait!(SclPin, Instance); | 41 | pin_trait!(SclPin, Instance); |
| @@ -57,7 +57,7 @@ foreach_interrupt!( | |||
| 57 | } | 57 | } |
| 58 | 58 | ||
| 59 | impl Instance for peripherals::$inst { | 59 | impl Instance for peripherals::$inst { |
| 60 | type Interrupt = crate::interrupt::$irq; | 60 | type Interrupt = crate::interrupt::typelevel::$irq; |
| 61 | } | 61 | } |
| 62 | }; | 62 | }; |
| 63 | ); | 63 | ); |
diff --git a/embassy-stm32/src/i2c/v1.rs b/embassy-stm32/src/i2c/v1.rs index b9be2e587..e04038886 100644 --- a/embassy-stm32/src/i2c/v1.rs +++ b/embassy-stm32/src/i2c/v1.rs | |||
| @@ -16,7 +16,7 @@ pub struct InterruptHandler<T: Instance> { | |||
| 16 | _phantom: PhantomData<T>, | 16 | _phantom: PhantomData<T>, |
| 17 | } | 17 | } |
| 18 | 18 | ||
| 19 | impl<T: Instance> interrupt::Handler<T::Interrupt> for InterruptHandler<T> { | 19 | impl<T: Instance> interrupt::typelevel::Handler<T::Interrupt> for InterruptHandler<T> { |
| 20 | unsafe fn on_interrupt() {} | 20 | unsafe fn on_interrupt() {} |
| 21 | } | 21 | } |
| 22 | 22 | ||
| @@ -57,7 +57,7 @@ impl<'d, T: Instance, TXDMA, RXDMA> I2c<'d, T, TXDMA, RXDMA> { | |||
| 57 | _peri: impl Peripheral<P = T> + 'd, | 57 | _peri: impl Peripheral<P = T> + 'd, |
| 58 | scl: impl Peripheral<P = impl SclPin<T>> + 'd, | 58 | scl: impl Peripheral<P = impl SclPin<T>> + 'd, |
| 59 | sda: impl Peripheral<P = impl SdaPin<T>> + 'd, | 59 | sda: impl Peripheral<P = impl SdaPin<T>> + 'd, |
| 60 | _irq: impl interrupt::Binding<T::Interrupt, InterruptHandler<T>> + 'd, | 60 | _irq: impl interrupt::typelevel::Binding<T::Interrupt, InterruptHandler<T>> + 'd, |
| 61 | tx_dma: impl Peripheral<P = TXDMA> + 'd, | 61 | tx_dma: impl Peripheral<P = TXDMA> + 'd, |
| 62 | rx_dma: impl Peripheral<P = RXDMA> + 'd, | 62 | rx_dma: impl Peripheral<P = RXDMA> + 'd, |
| 63 | freq: Hertz, | 63 | freq: Hertz, |
diff --git a/embassy-stm32/src/i2c/v2.rs b/embassy-stm32/src/i2c/v2.rs index 10f57f700..1aaf2b46b 100644 --- a/embassy-stm32/src/i2c/v2.rs +++ b/embassy-stm32/src/i2c/v2.rs | |||
| @@ -3,7 +3,6 @@ use core::future::poll_fn; | |||
| 3 | use core::marker::PhantomData; | 3 | use core::marker::PhantomData; |
| 4 | use core::task::Poll; | 4 | use core::task::Poll; |
| 5 | 5 | ||
| 6 | use embassy_cortex_m::interrupt::Interrupt; | ||
| 7 | use embassy_embedded_hal::SetConfig; | 6 | use embassy_embedded_hal::SetConfig; |
| 8 | use embassy_hal_common::drop::OnDrop; | 7 | use embassy_hal_common::drop::OnDrop; |
| 9 | use embassy_hal_common::{into_ref, PeripheralRef}; | 8 | use embassy_hal_common::{into_ref, PeripheralRef}; |
| @@ -13,6 +12,7 @@ use crate::dma::{NoDma, Transfer}; | |||
| 13 | use crate::gpio::sealed::AFType; | 12 | use crate::gpio::sealed::AFType; |
| 14 | use crate::gpio::Pull; | 13 | use crate::gpio::Pull; |
| 15 | use crate::i2c::{Error, Instance, SclPin, SdaPin}; | 14 | use crate::i2c::{Error, Instance, SclPin, SdaPin}; |
| 15 | use crate::interrupt::typelevel::Interrupt; | ||
| 16 | use crate::pac::i2c; | 16 | use crate::pac::i2c; |
| 17 | use crate::time::Hertz; | 17 | use crate::time::Hertz; |
| 18 | use crate::{interrupt, Peripheral}; | 18 | use crate::{interrupt, Peripheral}; |
| @@ -22,7 +22,7 @@ pub struct InterruptHandler<T: Instance> { | |||
| 22 | _phantom: PhantomData<T>, | 22 | _phantom: PhantomData<T>, |
| 23 | } | 23 | } |
| 24 | 24 | ||
| 25 | impl<T: Instance> interrupt::Handler<T::Interrupt> for InterruptHandler<T> { | 25 | impl<T: Instance> interrupt::typelevel::Handler<T::Interrupt> for InterruptHandler<T> { |
| 26 | unsafe fn on_interrupt() { | 26 | unsafe fn on_interrupt() { |
| 27 | let regs = T::regs(); | 27 | let regs = T::regs(); |
| 28 | let isr = regs.isr().read(); | 28 | let isr = regs.isr().read(); |
| @@ -78,7 +78,7 @@ impl<'d, T: Instance, TXDMA, RXDMA> I2c<'d, T, TXDMA, RXDMA> { | |||
| 78 | peri: impl Peripheral<P = T> + 'd, | 78 | peri: impl Peripheral<P = T> + 'd, |
| 79 | scl: impl Peripheral<P = impl SclPin<T>> + 'd, | 79 | scl: impl Peripheral<P = impl SclPin<T>> + 'd, |
| 80 | sda: impl Peripheral<P = impl SdaPin<T>> + 'd, | 80 | sda: impl Peripheral<P = impl SdaPin<T>> + 'd, |
| 81 | _irq: impl interrupt::Binding<T::Interrupt, InterruptHandler<T>> + 'd, | 81 | _irq: impl interrupt::typelevel::Binding<T::Interrupt, InterruptHandler<T>> + 'd, |
| 82 | tx_dma: impl Peripheral<P = TXDMA> + 'd, | 82 | tx_dma: impl Peripheral<P = TXDMA> + 'd, |
| 83 | rx_dma: impl Peripheral<P = RXDMA> + 'd, | 83 | rx_dma: impl Peripheral<P = RXDMA> + 'd, |
| 84 | freq: Hertz, | 84 | freq: Hertz, |
