diff --git a/embassy-stm32/src/usart/mod.rs b/embassy-stm32/src/usart/mod.rs index a75793f84..e486a5d4a 100644 --- a/embassy-stm32/src/usart/mod.rs +++ b/embassy-stm32/src/usart/mod.rs @@ -1,7 +1,7 @@ #![macro_use] #[cfg_attr(usart_v1, path = "v1.rs")] -#[cfg_attr(usart_v2, path = "v2.rs")] +//#[cfg_attr(usart_v2, path = "v2.rs")] mod _version; use crate::peripherals; pub use _version::*; diff --git a/embassy-stm32/src/usart/v1.rs b/embassy-stm32/src/usart/v1.rs index 37b325d8f..6c5a12441 100644 --- a/embassy-stm32/src/usart/v1.rs +++ b/embassy-stm32/src/usart/v1.rs @@ -63,14 +63,11 @@ impl<'d, T: Instance> Uart<'d, T> { rx: impl Unborrow>, tx: impl Unborrow>, config: Config, - //pclk_freq: u32, ) -> Self { unborrow!(inner, rx, tx); + T::enable(); let pclk_freq = T::frequency(); - //let pclk_freq = 16_000_000; - - // TODO: enable in RCC // TODO: better calculation, including error checking and OVER8 if possible. let div = (pclk_freq.0 + (config.baudrate / 2)) / config.baudrate;