Prescaler 1 means divide by 3 on WL55
This commit is contained in:
parent
383beb37b3
commit
56c5218292
@ -63,7 +63,7 @@ pub enum PLLMul {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// AHB prescaler
|
/// AHB prescaler
|
||||||
#[derive(Clone, Copy)]
|
#[derive(Clone, Copy, PartialEq)]
|
||||||
pub enum AHBPrescaler {
|
pub enum AHBPrescaler {
|
||||||
NotDivided,
|
NotDivided,
|
||||||
Div2,
|
Div2,
|
||||||
|
@ -164,7 +164,11 @@ impl RccExt for RCC {
|
|||||||
unsafe {
|
unsafe {
|
||||||
rcc.cfgr().modify(|w| {
|
rcc.cfgr().modify(|w| {
|
||||||
w.set_sw(sw.into());
|
w.set_sw(sw.into());
|
||||||
|
if cfgr.ahb_pre == AHBPrescaler::NotDivided {
|
||||||
|
w.set_hpre(0);
|
||||||
|
} else {
|
||||||
w.set_hpre(cfgr.ahb_pre.into());
|
w.set_hpre(cfgr.ahb_pre.into());
|
||||||
|
}
|
||||||
w.set_ppre1(cfgr.apb1_pre.into());
|
w.set_ppre1(cfgr.apb1_pre.into());
|
||||||
w.set_ppre2(cfgr.apb2_pre.into());
|
w.set_ppre2(cfgr.apb2_pre.into());
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user