Skip to content

Commit 266e62f

Browse files
authored
change wait state values according to datasheet (#206)
looked at the datasheet for the l432kc and the l476vgt to find these values
1 parent 3b076a6 commit 266e62f

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/rcc.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -684,12 +684,16 @@ impl CFGR {
684684
// adjust flash wait states
685685
unsafe {
686686
acr.acr().write(|w| {
687-
w.latency().bits(if sysclk <= 24_000_000 {
687+
w.latency().bits(if hclk <= 16_000_000 {
688688
0b000
689-
} else if sysclk <= 48_000_000 {
689+
} else if hclk <= 32_000_000 {
690690
0b001
691-
} else {
691+
} else if hclk <= 48_000_000 {
692692
0b010
693+
} else if hclk <= 64_000_000 {
694+
0b011
695+
} else {
696+
0b100
693697
})
694698
})
695699
}

0 commit comments

Comments
 (0)