Skip to content

Commit 66bf45c

Browse files
committed
retrieve missed pll enable
1 parent 66286f4 commit 66bf45c

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/rcc.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,19 @@ impl CFGR {
229229
while rcc.cr.read().hserdy().bit_is_clear() {}
230230
}
231231

232+
if let Some(pllmul_bits) = cfg.pllmul {
233+
// enable PLL and wait for it to be ready
234+
235+
#[allow(unused_unsafe)]
236+
rcc.cfgr.modify(|_, w| unsafe {
237+
w.pllmul().bits(pllmul_bits).pllsrc().bit(cfg.hse.is_some())
238+
});
239+
240+
rcc.cr.modify(|_, w| w.pllon().set_bit());
241+
242+
while rcc.cr.read().pllrdy().bit_is_clear() {}
243+
}
244+
232245
// set prescalers and clock source
233246
#[cfg(feature = "connectivity")]
234247
rcc.cfgr.modify(|_, w| unsafe {

0 commit comments

Comments
 (0)