aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--embassy-stm32/src/rcc/wb.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/embassy-stm32/src/rcc/wb.rs b/embassy-stm32/src/rcc/wb.rs
index 41f602c02..91a11a95d 100644
--- a/embassy-stm32/src/rcc/wb.rs
+++ b/embassy-stm32/src/rcc/wb.rs
@@ -191,7 +191,7 @@ impl Default for Config {
191 prediv: HsePrescaler::NotDivided, 191 prediv: HsePrescaler::NotDivided,
192 }), 192 }),
193 lse: Some(khz(32)), 193 lse: Some(khz(32)),
194 sys: Sysclk::HSI, 194 sys: Sysclk::Pll,
195 mux: Some(PllMux { 195 mux: Some(PllMux {
196 source: PllSource::Hse, 196 source: PllSource::Hse,
197 prediv: 2, 197 prediv: 2,
@@ -363,7 +363,7 @@ pub(crate) fn configure_clocks(config: &Config) {
363 match &config.pll { 363 match &config.pll {
364 Some(pll) => { 364 Some(pll) => {
365 rcc.pllcfgr().modify(|w| { 365 rcc.pllcfgr().modify(|w| {
366 w.set_plln((pll.mul - 1) as u8); 366 w.set_plln(pll.mul as u8);
367 pll.divp.map(|divp| { 367 pll.divp.map(|divp| {
368 w.set_pllpen(true); 368 w.set_pllpen(true);
369 w.set_pllp((divp - 1) as u8) 369 w.set_pllp((divp - 1) as u8)
@@ -372,7 +372,10 @@ pub(crate) fn configure_clocks(config: &Config) {
372 w.set_pllqen(true); 372 w.set_pllqen(true);
373 w.set_pllq((divq - 1) as u8) 373 w.set_pllq((divq - 1) as u8)
374 }); 374 });
375 pll.divr.map(|divr| w.set_pllr((divr - 1) as u8)); 375 pll.divr.map(|divr| {
376 // w.set_pllren(true);
377 w.set_pllr((divr - 1) as u8);
378 });
376 }); 379 });
377 380
378 rcc.cr().modify(|w| w.set_pllon(true)); 381 rcc.cr().modify(|w| w.set_pllon(true));
@@ -387,9 +390,6 @@ pub(crate) fn configure_clocks(config: &Config) {
387 w.set_hpre(config.ahb1_pre.into()); 390 w.set_hpre(config.ahb1_pre.into());
388 w.set_ppre1(config.apb1_pre.into()); 391 w.set_ppre1(config.apb1_pre.into());
389 w.set_ppre2(config.apb2_pre.into()); 392 w.set_ppre2(config.apb2_pre.into());
390
391 w.set_ppre1(config.apb1_pre.into());
392 w.set_ppre2(config.apb2_pre.into());
393 }); 393 });
394 394
395 rcc.extcfgr().modify(|w| { 395 rcc.extcfgr().modify(|w| {