Skip to content

Commit 929ed66

Browse files
committed
fmt
1 parent d614717 commit 929ed66

File tree

2 files changed

+13
-15
lines changed

2 files changed

+13
-15
lines changed

src/rcc.rs

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -617,19 +617,18 @@ impl Rcc {
617617
let rcc_hclk = self.config.rcc_hclk.unwrap_or(sys_ck.raw());
618618

619619
// Estimate divisor
620-
let (hpre_bits, hpre_div) =
621-
match sys_ck.raw().div_ceil(rcc_hclk) {
622-
0 => unreachable!(),
623-
1 => (HPRE::Div1, 1),
624-
2 => (HPRE::Div2, 2),
625-
3..=5 => (HPRE::Div4, 4),
626-
6..=11 => (HPRE::Div8, 8),
627-
12..=39 => (HPRE::Div16, 16),
628-
40..=95 => (HPRE::Div64, 64),
629-
96..=191 => (HPRE::Div128, 128),
630-
192..=383 => (HPRE::Div256, 256),
631-
_ => (HPRE::Div512, 512),
632-
};
620+
let (hpre_bits, hpre_div) = match sys_ck.raw().div_ceil(rcc_hclk) {
621+
0 => unreachable!(),
622+
1 => (HPRE::Div1, 1),
623+
2 => (HPRE::Div2, 2),
624+
3..=5 => (HPRE::Div4, 4),
625+
6..=11 => (HPRE::Div8, 8),
626+
12..=39 => (HPRE::Div16, 16),
627+
40..=95 => (HPRE::Div64, 64),
628+
96..=191 => (HPRE::Div128, 128),
629+
192..=383 => (HPRE::Div256, 256),
630+
_ => (HPRE::Div512, 512),
631+
};
633632

634633
// Calculate real AHB clock
635634
let rcc_hclk = sys_ck.raw() / hpre_div;

src/rcc/pll.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,7 @@ fn vco_output_divider_setup(
151151

152152
// Input divisor, resulting in a reference clock in the
153153
// range 2 to 16 MHz.
154-
let pll_x_m_min =
155-
pllsrc.div_ceil(*range.input_range.end());
154+
let pll_x_m_min = pllsrc.div_ceil(*range.input_range.end());
156155
let pll_x_m_max = (pllsrc / range.input_range.start()).min(PLL_M_MAX);
157156

158157
// Iterative search for the lowest m value that minimizes

0 commit comments

Comments
 (0)