diff options
| -rw-r--r-- | embassy-stm32/build.rs | 4 | ||||
| -rw-r--r-- | embassy-stm32/src/rcc/f3.rs | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/embassy-stm32/build.rs b/embassy-stm32/build.rs index 248941efe..cefd7434a 100644 --- a/embassy-stm32/build.rs +++ b/embassy-stm32/build.rs | |||
| @@ -125,6 +125,10 @@ fn main() { | |||
| 125 | println!("cargo:rustc-cfg={}", &chip_name[..chip_name.len() - 2]); | 125 | println!("cargo:rustc-cfg={}", &chip_name[..chip_name.len() - 2]); |
| 126 | } | 126 | } |
| 127 | 127 | ||
| 128 | if chip_name.starts_with("stm32f3") { | ||
| 129 | println!("cargo:rustc-cfg={}x{}", &chip_name[..9], &chip_name[10..11]); | ||
| 130 | } | ||
| 131 | |||
| 128 | // ======== | 132 | // ======== |
| 129 | // Handle time-driver-XXXX features. | 133 | // Handle time-driver-XXXX features. |
| 130 | 134 | ||
diff --git a/embassy-stm32/src/rcc/f3.rs b/embassy-stm32/src/rcc/f3.rs index e16e1e499..2727a5b1c 100644 --- a/embassy-stm32/src/rcc/f3.rs +++ b/embassy-stm32/src/rcc/f3.rs | |||
| @@ -217,8 +217,8 @@ fn calc_pll(config: &Config, Hertz(sysclk): Hertz) -> (Hertz, PllConfig) { | |||
| 217 | cfg_if::cfg_if! { | 217 | cfg_if::cfg_if! { |
| 218 | // For some chips PREDIV is always two, and cannot be changed | 218 | // For some chips PREDIV is always two, and cannot be changed |
| 219 | if #[cfg(any( | 219 | if #[cfg(any( |
| 220 | feature="stm32f302xd", feature="stm32f302xe", feature="stm32f303xd", | 220 | stm32f302xd, stm32f302xe, stm32f303xd, |
| 221 | feature="stm32f303xe", feature="stm32f398xe" | 221 | stm32f303xe, stm32f398xe |
| 222 | ))] { | 222 | ))] { |
| 223 | let (multiplier, divisor) = get_mul_div(sysclk, HSI); | 223 | let (multiplier, divisor) = get_mul_div(sysclk, HSI); |
| 224 | ( | 224 | ( |
