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/usart/mod.rs | |
| parent | 2dd5ce83ec0421564e85b667f5dabd592f313e5c (diff) | |
| parent | ab86b060500ceda1c80e39f35af69cb08a7b63a2 (diff) | |
fix merge conflict
Diffstat (limited to 'embassy-stm32/src/usart/mod.rs')
| -rw-r--r-- | embassy-stm32/src/usart/mod.rs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/embassy-stm32/src/usart/mod.rs b/embassy-stm32/src/usart/mod.rs index ef1080153..da3644a81 100644 --- a/embassy-stm32/src/usart/mod.rs +++ b/embassy-stm32/src/usart/mod.rs | |||
| @@ -5,13 +5,13 @@ use core::marker::PhantomData; | |||
| 5 | use core::sync::atomic::{compiler_fence, Ordering}; | 5 | use core::sync::atomic::{compiler_fence, Ordering}; |
| 6 | use core::task::Poll; | 6 | use core::task::Poll; |
| 7 | 7 | ||
| 8 | use embassy_cortex_m::interrupt::Interrupt; | ||
| 9 | use embassy_hal_common::drop::OnDrop; | 8 | use embassy_hal_common::drop::OnDrop; |
| 10 | use embassy_hal_common::{into_ref, PeripheralRef}; | 9 | use embassy_hal_common::{into_ref, PeripheralRef}; |
| 11 | use futures::future::{select, Either}; | 10 | use futures::future::{select, Either}; |
| 12 | 11 | ||
| 13 | use crate::dma::{NoDma, Transfer}; | 12 | use crate::dma::{NoDma, Transfer}; |
| 14 | use crate::gpio::sealed::AFType; | 13 | use crate::gpio::sealed::AFType; |
| 14 | use crate::interrupt::typelevel::Interrupt; | ||
| 15 | #[cfg(not(any(usart_v1, usart_v2)))] | 15 | #[cfg(not(any(usart_v1, usart_v2)))] |
| 16 | #[allow(unused_imports)] | 16 | #[allow(unused_imports)] |
| 17 | use crate::pac::usart::regs::Isr as Sr; | 17 | use crate::pac::usart::regs::Isr as Sr; |
| @@ -31,7 +31,7 @@ pub struct InterruptHandler<T: BasicInstance> { | |||
| 31 | _phantom: PhantomData<T>, | 31 | _phantom: PhantomData<T>, |
| 32 | } | 32 | } |
| 33 | 33 | ||
| 34 | impl<T: BasicInstance> interrupt::Handler<T::Interrupt> for InterruptHandler<T> { | 34 | impl<T: BasicInstance> interrupt::typelevel::Handler<T::Interrupt> for InterruptHandler<T> { |
| 35 | unsafe fn on_interrupt() { | 35 | unsafe fn on_interrupt() { |
| 36 | let r = T::regs(); | 36 | let r = T::regs(); |
| 37 | let s = T::state(); | 37 | let s = T::state(); |
| @@ -281,7 +281,7 @@ impl<'d, T: BasicInstance, RxDma> UartRx<'d, T, RxDma> { | |||
| 281 | /// Useful if you only want Uart Rx. It saves 1 pin and consumes a little less power. | 281 | /// Useful if you only want Uart Rx. It saves 1 pin and consumes a little less power. |
| 282 | pub fn new( | 282 | pub fn new( |
| 283 | peri: impl Peripheral<P = T> + 'd, | 283 | peri: impl Peripheral<P = T> + 'd, |
| 284 | _irq: impl interrupt::Binding<T::Interrupt, InterruptHandler<T>> + 'd, | 284 | _irq: impl interrupt::typelevel::Binding<T::Interrupt, InterruptHandler<T>> + 'd, |
| 285 | rx: impl Peripheral<P = impl RxPin<T>> + 'd, | 285 | rx: impl Peripheral<P = impl RxPin<T>> + 'd, |
| 286 | rx_dma: impl Peripheral<P = RxDma> + 'd, | 286 | rx_dma: impl Peripheral<P = RxDma> + 'd, |
| 287 | config: Config, | 287 | config: Config, |
| @@ -294,7 +294,7 @@ impl<'d, T: BasicInstance, RxDma> UartRx<'d, T, RxDma> { | |||
| 294 | 294 | ||
| 295 | pub fn new_with_rts( | 295 | pub fn new_with_rts( |
| 296 | peri: impl Peripheral<P = T> + 'd, | 296 | peri: impl Peripheral<P = T> + 'd, |
| 297 | _irq: impl interrupt::Binding<T::Interrupt, InterruptHandler<T>> + 'd, | 297 | _irq: impl interrupt::typelevel::Binding<T::Interrupt, InterruptHandler<T>> + 'd, |
| 298 | rx: impl Peripheral<P = impl RxPin<T>> + 'd, | 298 | rx: impl Peripheral<P = impl RxPin<T>> + 'd, |
| 299 | rts: impl Peripheral<P = impl RtsPin<T>> + 'd, | 299 | rts: impl Peripheral<P = impl RtsPin<T>> + 'd, |
| 300 | rx_dma: impl Peripheral<P = RxDma> + 'd, | 300 | rx_dma: impl Peripheral<P = RxDma> + 'd, |
| @@ -650,7 +650,7 @@ impl<'d, T: BasicInstance, TxDma, RxDma> Uart<'d, T, TxDma, RxDma> { | |||
| 650 | peri: impl Peripheral<P = T> + 'd, | 650 | peri: impl Peripheral<P = T> + 'd, |
| 651 | rx: impl Peripheral<P = impl RxPin<T>> + 'd, | 651 | rx: impl Peripheral<P = impl RxPin<T>> + 'd, |
| 652 | tx: impl Peripheral<P = impl TxPin<T>> + 'd, | 652 | tx: impl Peripheral<P = impl TxPin<T>> + 'd, |
| 653 | _irq: impl interrupt::Binding<T::Interrupt, InterruptHandler<T>> + 'd, | 653 | _irq: impl interrupt::typelevel::Binding<T::Interrupt, InterruptHandler<T>> + 'd, |
| 654 | tx_dma: impl Peripheral<P = TxDma> + 'd, | 654 | tx_dma: impl Peripheral<P = TxDma> + 'd, |
| 655 | rx_dma: impl Peripheral<P = RxDma> + 'd, | 655 | rx_dma: impl Peripheral<P = RxDma> + 'd, |
| 656 | config: Config, | 656 | config: Config, |
| @@ -665,7 +665,7 @@ impl<'d, T: BasicInstance, TxDma, RxDma> Uart<'d, T, TxDma, RxDma> { | |||
| 665 | peri: impl Peripheral<P = T> + 'd, | 665 | peri: impl Peripheral<P = T> + 'd, |
| 666 | rx: impl Peripheral<P = impl RxPin<T>> + 'd, | 666 | rx: impl Peripheral<P = impl RxPin<T>> + 'd, |
| 667 | tx: impl Peripheral<P = impl TxPin<T>> + 'd, | 667 | tx: impl Peripheral<P = impl TxPin<T>> + 'd, |
| 668 | _irq: impl interrupt::Binding<T::Interrupt, InterruptHandler<T>> + 'd, | 668 | _irq: impl interrupt::typelevel::Binding<T::Interrupt, InterruptHandler<T>> + 'd, |
| 669 | rts: impl Peripheral<P = impl RtsPin<T>> + 'd, | 669 | rts: impl Peripheral<P = impl RtsPin<T>> + 'd, |
| 670 | cts: impl Peripheral<P = impl CtsPin<T>> + 'd, | 670 | cts: impl Peripheral<P = impl CtsPin<T>> + 'd, |
| 671 | tx_dma: impl Peripheral<P = TxDma> + 'd, | 671 | tx_dma: impl Peripheral<P = TxDma> + 'd, |
| @@ -693,7 +693,7 @@ impl<'d, T: BasicInstance, TxDma, RxDma> Uart<'d, T, TxDma, RxDma> { | |||
| 693 | peri: impl Peripheral<P = T> + 'd, | 693 | peri: impl Peripheral<P = T> + 'd, |
| 694 | rx: impl Peripheral<P = impl RxPin<T>> + 'd, | 694 | rx: impl Peripheral<P = impl RxPin<T>> + 'd, |
| 695 | tx: impl Peripheral<P = impl TxPin<T>> + 'd, | 695 | tx: impl Peripheral<P = impl TxPin<T>> + 'd, |
| 696 | _irq: impl interrupt::Binding<T::Interrupt, InterruptHandler<T>> + 'd, | 696 | _irq: impl interrupt::typelevel::Binding<T::Interrupt, InterruptHandler<T>> + 'd, |
| 697 | de: impl Peripheral<P = impl DePin<T>> + 'd, | 697 | de: impl Peripheral<P = impl DePin<T>> + 'd, |
| 698 | tx_dma: impl Peripheral<P = TxDma> + 'd, | 698 | tx_dma: impl Peripheral<P = TxDma> + 'd, |
| 699 | rx_dma: impl Peripheral<P = RxDma> + 'd, | 699 | rx_dma: impl Peripheral<P = RxDma> + 'd, |
| @@ -1179,7 +1179,7 @@ pub(crate) mod sealed { | |||
| 1179 | 1179 | ||
| 1180 | pub trait BasicInstance: crate::rcc::RccPeripheral { | 1180 | pub trait BasicInstance: crate::rcc::RccPeripheral { |
| 1181 | const KIND: Kind; | 1181 | const KIND: Kind; |
| 1182 | type Interrupt: crate::interrupt::Interrupt; | 1182 | type Interrupt: interrupt::typelevel::Interrupt; |
| 1183 | 1183 | ||
| 1184 | fn regs() -> Regs; | 1184 | fn regs() -> Regs; |
| 1185 | fn state() -> &'static State; | 1185 | fn state() -> &'static State; |
| @@ -1211,7 +1211,7 @@ macro_rules! impl_usart { | |||
| 1211 | ($inst:ident, $irq:ident, $kind:expr) => { | 1211 | ($inst:ident, $irq:ident, $kind:expr) => { |
| 1212 | impl sealed::BasicInstance for crate::peripherals::$inst { | 1212 | impl sealed::BasicInstance for crate::peripherals::$inst { |
| 1213 | const KIND: Kind = $kind; | 1213 | const KIND: Kind = $kind; |
| 1214 | type Interrupt = crate::interrupt::$irq; | 1214 | type Interrupt = crate::interrupt::typelevel::$irq; |
| 1215 | 1215 | ||
| 1216 | fn regs() -> Regs { | 1216 | fn regs() -> Regs { |
| 1217 | Regs(crate::pac::$inst.0) | 1217 | Regs(crate::pac::$inst.0) |
