diff options
| author | Rasmus Melchior Jacobsen <[email protected]> | 2023-05-19 16:20:12 +0200 |
|---|---|---|
| committer | Rasmus Melchior Jacobsen <[email protected]> | 2023-05-25 17:24:22 +0200 |
| commit | 387a4fcb8ec1f18b0a40cb8b0d758084814d943b (patch) | |
| tree | 7a19f3b1819d17ca4095a0521af4a95da585cc47 | |
| parent | cd6256a924c58ffb645b32f26d60168ca08d2d24 (diff) | |
Exclude usart_v1
| -rw-r--r-- | embassy-stm32/src/usart/mod.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/embassy-stm32/src/usart/mod.rs b/embassy-stm32/src/usart/mod.rs index cacbced2c..dd20109f1 100644 --- a/embassy-stm32/src/usart/mod.rs +++ b/embassy-stm32/src/usart/mod.rs | |||
| @@ -124,6 +124,7 @@ pub struct Config { | |||
| 124 | /// Set this to true if the line is considered noise free. | 124 | /// Set this to true if the line is considered noise free. |
| 125 | /// This will increase the receivers tolerance to clock deviations, | 125 | /// This will increase the receivers tolerance to clock deviations, |
| 126 | /// but will effectively disable noise detection. | 126 | /// but will effectively disable noise detection. |
| 127 | #[cfg(not(usart_v1))] | ||
| 127 | pub assume_noise_free: bool, | 128 | pub assume_noise_free: bool, |
| 128 | } | 129 | } |
| 129 | 130 | ||
| @@ -136,6 +137,7 @@ impl Default for Config { | |||
| 136 | parity: Parity::ParityNone, | 137 | parity: Parity::ParityNone, |
| 137 | // historical behavior | 138 | // historical behavior |
| 138 | detect_previous_overrun: false, | 139 | detect_previous_overrun: false, |
| 140 | #[cfg(not(usart_v1))] | ||
| 139 | assume_noise_free: false, | 141 | assume_noise_free: false, |
| 140 | } | 142 | } |
| 141 | } | 143 | } |
| @@ -917,6 +919,7 @@ fn configure(r: Regs, config: &Config, pclk_freq: Hertz, kind: Kind, enable_rx: | |||
| 917 | }); | 919 | }); |
| 918 | 920 | ||
| 919 | r.cr3().modify(|w| { | 921 | r.cr3().modify(|w| { |
| 922 | #[cfg(not(usart_v1))] | ||
| 920 | w.set_onebit(config.assume_noise_free); | 923 | w.set_onebit(config.assume_noise_free); |
| 921 | }); | 924 | }); |
| 922 | } | 925 | } |
