stm32f1: Keep flash prefetch enabled

This commit is contained in:
Grant Miller 2023-10-16 19:23:01 -05:00
parent 7fd868ade9
commit e7aeb9b29f

View File

@ -102,7 +102,6 @@ pub(crate) unsafe fn init(config: Config) {
assert!(pclk2 <= 72_000_000); assert!(pclk2 <= 72_000_000);
// Only needed for stm32f103?
FLASH.acr().write(|w| { FLASH.acr().write(|w| {
w.set_latency(if real_sysclk <= 24_000_000 { w.set_latency(if real_sysclk <= 24_000_000 {
Latency::WS0 Latency::WS0
@ -111,6 +110,8 @@ pub(crate) unsafe fn init(config: Config) {
} else { } else {
Latency::WS2 Latency::WS2
}); });
// the prefetch buffer is enabled by default, let's keep it enabled
w.set_prftbe(true);
}); });
// the USB clock is only valid if an external crystal is used, the PLL is enabled, and the // the USB clock is only valid if an external crystal is used, the PLL is enabled, and the