diff options
| author | Dario Nieuwenhuis <[email protected]> | 2022-06-26 23:52:38 +0200 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2022-06-26 23:52:38 +0200 |
| commit | 397722c32877d1521584de004b49e815f29afe91 (patch) | |
| tree | 07a93f405dcf49d2545ea95d87854719546c89ef | |
| parent | ffc32d3ddb5840b476a473c0248e32f7b9a8a212 (diff) | |
stm32: fix f100 build.
| -rw-r--r-- | embassy-stm32/src/rcc/f1.rs | 4 | ||||
| -rw-r--r-- | embassy-stm32/src/rcc/mod.rs | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/embassy-stm32/src/rcc/f1.rs b/embassy-stm32/src/rcc/f1.rs index ca0883b4a..8e2e6684a 100644 --- a/embassy-stm32/src/rcc/f1.rs +++ b/embassy-stm32/src/rcc/f1.rs | |||
| @@ -2,7 +2,7 @@ use core::convert::TryFrom; | |||
| 2 | 2 | ||
| 3 | use super::{set_freqs, Clocks}; | 3 | use super::{set_freqs, Clocks}; |
| 4 | use crate::pac::flash::vals::Latency; | 4 | use crate::pac::flash::vals::Latency; |
| 5 | use crate::pac::rcc::vals::{Adcpre, Hpre, Pllmul, Pllsrc, Ppre1, Sw, Usbpre}; | 5 | use crate::pac::rcc::vals::*; |
| 6 | use crate::pac::{FLASH, RCC}; | 6 | use crate::pac::{FLASH, RCC}; |
| 7 | use crate::time::Hertz; | 7 | use crate::time::Hertz; |
| 8 | 8 | ||
| @@ -110,6 +110,7 @@ pub(crate) unsafe fn init(config: Config) { | |||
| 110 | // the USB clock is only valid if an external crystal is used, the PLL is enabled, and the | 110 | // the USB clock is only valid if an external crystal is used, the PLL is enabled, and the |
| 111 | // PLL output frequency is a supported one. | 111 | // PLL output frequency is a supported one. |
| 112 | // usbpre == false: divide clock by 1.5, otherwise no division | 112 | // usbpre == false: divide clock by 1.5, otherwise no division |
| 113 | #[cfg(not(rcc_f100))] | ||
| 113 | let (usbpre, _usbclk_valid) = match (config.hse, pllmul_bits, real_sysclk) { | 114 | let (usbpre, _usbclk_valid) = match (config.hse, pllmul_bits, real_sysclk) { |
| 114 | (Some(_), Some(_), 72_000_000) => (false, true), | 115 | (Some(_), Some(_), 72_000_000) => (false, true), |
| 115 | (Some(_), Some(_), 48_000_000) => (true, true), | 116 | (Some(_), Some(_), 48_000_000) => (true, true), |
| @@ -154,6 +155,7 @@ pub(crate) unsafe fn init(config: Config) { | |||
| 154 | w.set_ppre2(Ppre1(ppre2_bits)); | 155 | w.set_ppre2(Ppre1(ppre2_bits)); |
| 155 | w.set_ppre1(Ppre1(ppre1_bits)); | 156 | w.set_ppre1(Ppre1(ppre1_bits)); |
| 156 | w.set_hpre(Hpre(hpre_bits)); | 157 | w.set_hpre(Hpre(hpre_bits)); |
| 158 | #[cfg(not(rcc_f100))] | ||
| 157 | w.set_usbpre(Usbpre(usbpre as u8)); | 159 | w.set_usbpre(Usbpre(usbpre as u8)); |
| 158 | w.set_sw(Sw(if pllmul_bits.is_some() { | 160 | w.set_sw(Sw(if pllmul_bits.is_some() { |
| 159 | // PLL | 161 | // PLL |
diff --git a/embassy-stm32/src/rcc/mod.rs b/embassy-stm32/src/rcc/mod.rs index 866b1ffc4..1b1180c03 100644 --- a/embassy-stm32/src/rcc/mod.rs +++ b/embassy-stm32/src/rcc/mod.rs | |||
| @@ -5,7 +5,7 @@ use core::mem::MaybeUninit; | |||
| 5 | use crate::time::Hertz; | 5 | use crate::time::Hertz; |
| 6 | 6 | ||
| 7 | #[cfg_attr(rcc_f0, path = "f0.rs")] | 7 | #[cfg_attr(rcc_f0, path = "f0.rs")] |
| 8 | #[cfg_attr(any(rcc_f1, rcc_f1cl), path = "f1.rs")] | 8 | #[cfg_attr(any(rcc_f1, rcc_f100, rcc_f1cl), path = "f1.rs")] |
| 9 | #[cfg_attr(rcc_f2, path = "f2.rs")] | 9 | #[cfg_attr(rcc_f2, path = "f2.rs")] |
| 10 | #[cfg_attr(rcc_f3, path = "f3.rs")] | 10 | #[cfg_attr(rcc_f3, path = "f3.rs")] |
| 11 | #[cfg_attr(any(rcc_f4, rcc_f410), path = "f4.rs")] | 11 | #[cfg_attr(any(rcc_f4, rcc_f410), path = "f4.rs")] |
