diff options
| author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2022-02-02 20:03:21 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-02-02 20:03:21 +0000 |
| commit | abd21ad139ad1518e6c80903e8fe80c942026358 (patch) | |
| tree | 0197590fc89fda5f8027a0a92e678a7feb9c3273 | |
| parent | d76cd5ceaf5140c48ef97180beae156c0c0e07c8 (diff) | |
| parent | 8bb41a3281ab66fdaef1c460b5674fd23d7257a3 (diff) | |
Merge #595
595: stm32f3: fix nonexistent cfg tests r=Dirbaio a=unrelentingtech
The rcc code was taken from stm32-rs which uses 'x' features, but embassy uses features with full chip names.
Add these 'x' wildcards as cfgs and use them in rcc. They will be useful for USB #580 too.
---
I don't have any F3 boards, so this is not tested. But the original cfg clearly doesn't look right…
Co-authored-by: Greg V <[email protected]>
| -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 | ( |
