Skip to content

Commit

Permalink
retrieve missed pll enable
Browse files Browse the repository at this point in the history
  • Loading branch information
burrbull committed Nov 6, 2021
1 parent 66286f4 commit 66bf45c
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/rcc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,19 @@ impl CFGR {
while rcc.cr.read().hserdy().bit_is_clear() {}
}

if let Some(pllmul_bits) = cfg.pllmul {
// enable PLL and wait for it to be ready

#[allow(unused_unsafe)]
rcc.cfgr.modify(|_, w| unsafe {
w.pllmul().bits(pllmul_bits).pllsrc().bit(cfg.hse.is_some())
});

rcc.cr.modify(|_, w| w.pllon().set_bit());

while rcc.cr.read().pllrdy().bit_is_clear() {}
}

// set prescalers and clock source
#[cfg(feature = "connectivity")]
rcc.cfgr.modify(|_, w| unsafe {
Expand Down

0 comments on commit 66bf45c

Please sign in to comment.