From 387a4fcb8ec1f18b0a40cb8b0d758084814d943b Mon Sep 17 00:00:00 2001 From: Rasmus Melchior Jacobsen Date: Fri, 19 May 2023 16:20:12 +0200 Subject: [PATCH] Exclude usart_v1 --- embassy-stm32/src/usart/mod.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/embassy-stm32/src/usart/mod.rs b/embassy-stm32/src/usart/mod.rs index cacbced2..dd20109f 100644 --- a/embassy-stm32/src/usart/mod.rs +++ b/embassy-stm32/src/usart/mod.rs @@ -124,6 +124,7 @@ pub struct Config { /// Set this to true if the line is considered noise free. /// This will increase the receivers tolerance to clock deviations, /// but will effectively disable noise detection. + #[cfg(not(usart_v1))] pub assume_noise_free: bool, } @@ -136,6 +137,7 @@ impl Default for Config { parity: Parity::ParityNone, // historical behavior detect_previous_overrun: false, + #[cfg(not(usart_v1))] assume_noise_free: false, } } @@ -917,6 +919,7 @@ fn configure(r: Regs, config: &Config, pclk_freq: Hertz, kind: Kind, enable_rx: }); r.cr3().modify(|w| { + #[cfg(not(usart_v1))] w.set_onebit(config.assume_noise_free); }); }