diff --git a/embassy-stm32/src/bdma/mod.rs b/embassy-stm32/src/bdma/mod.rs index b94563e3..8448185a 100644 --- a/embassy-stm32/src/bdma/mod.rs +++ b/embassy-stm32/src/bdma/mod.rs @@ -394,46 +394,20 @@ pac::interrupts! { #[cfg(usart)] use crate::usart; -#[cfg(not(dmamux))] -pac::peripheral_dma_channels! { - ($peri:ident, usart, $kind:ident, RX, $channel_peri:ident, $dma_peri:ident, $channel_num:expr) => { - impl usart::RxDma for crate::peripherals::$channel_peri { } - impl usart::sealed::RxDma for crate::peripherals::$channel_peri { } - }; - - ($peri:ident, usart, $kind:ident, TX, $channel_peri:ident, $dma_peri:ident, $channel_num:expr) => { - impl usart::TxDma for crate::peripherals::$channel_peri { } - impl usart::sealed::TxDma for crate::peripherals::$channel_peri { } - }; - - ($peri:ident, uart, $kind:ident, RX, $channel_peri:ident, $dma_peri:ident, $channel_num:expr) => { - impl usart::RxDma for crate::peripherals::$channel_peri { } - impl usart::sealed::RxDma for crate::peripherals::$channel_peri { } - }; - - ($peri:ident, uart, $kind:ident, TX, $channel_peri:ident, $dma_peri:ident, $channel_num:expr) => { - impl usart::TxDma for crate::peripherals::$channel_peri { } - impl usart::sealed::TxDma for crate::peripherals::$channel_peri { } - }; -} - -#[cfg(dmamux)] pac::peripherals! { (usart, $peri:ident) => { - pac::bdma_channels! { - ($channel_peri:ident, $dma_peri:ident, $channel_num:expr) => { - impl usart::TxDma for crate::peripherals::$channel_peri { } - impl usart::sealed::TxDma for crate::peripherals::$channel_peri { } - }; - } + impl> usart::TxDma for T {} + impl> usart::sealed::TxDma for T {} + + impl> usart::RxDma for T {} + impl> usart::sealed::RxDma for T {} }; (uart, $peri:ident) => { - pac::bdma_channels! { - ($channel_peri:ident, $dma_peri:ident, $channel_num:expr) => { - impl usart::TxDma for crate::peripherals::$channel_peri { } - impl usart::sealed::TxDma for crate::peripherals::$channel_peri { } - }; - } + impl> usart::TxDma for T {} + impl> usart::sealed::TxDma for T {} + + impl> usart::RxDma for T {} + impl> usart::sealed::RxDma for T {} }; }