Merge pull request #1713 from MabezDev/stm32f2-pll-overflow

stm32f2 PLL overflow with crystal
This commit is contained in:
Dario Nieuwenhuis 2023-07-30 12:16:52 +00:00 committed by GitHub
commit 8bed573b88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -58,7 +58,7 @@ impl Default for PLLConfig {
impl PLLConfig { impl PLLConfig {
pub fn clocks(&self, src_freq: Hertz) -> PLLClocks { pub fn clocks(&self, src_freq: Hertz) -> PLLClocks {
let in_freq = src_freq / self.pre_div; let in_freq = src_freq / self.pre_div;
let vco_freq = src_freq * self.mul / self.pre_div; let vco_freq = Hertz((src_freq.0 as u64 * self.mul.0 as u64 / self.pre_div.0 as u64) as u32);
let main_freq = vco_freq / self.main_div; let main_freq = vco_freq / self.main_div;
let pll48_freq = vco_freq / self.pll48_div; let pll48_freq = vco_freq / self.pll48_div;
PLLClocks { PLLClocks {