aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrant Miller <[email protected]>2023-10-16 19:23:01 -0500
committerGrant Miller <[email protected]>2023-10-16 19:23:01 -0500
commite7aeb9b29feaf2ca4bf3ac2cac47583cd9468e88 (patch)
treeb0e7170fb445b24be9213493025251f837c6da40
parent7fd868ade91ebd92cf68016cd40cbbad30a5918e (diff)
stm32f1: Keep flash prefetch enabled
-rw-r--r--embassy-stm32/src/rcc/f1.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/embassy-stm32/src/rcc/f1.rs b/embassy-stm32/src/rcc/f1.rs
index b2ae56dbf..367c88324 100644
--- a/embassy-stm32/src/rcc/f1.rs
+++ b/embassy-stm32/src/rcc/f1.rs
@@ -102,7 +102,6 @@ pub(crate) unsafe fn init(config: Config) {
102 102
103 assert!(pclk2 <= 72_000_000); 103 assert!(pclk2 <= 72_000_000);
104 104
105 // Only needed for stm32f103?
106 FLASH.acr().write(|w| { 105 FLASH.acr().write(|w| {
107 w.set_latency(if real_sysclk <= 24_000_000 { 106 w.set_latency(if real_sysclk <= 24_000_000 {
108 Latency::WS0 107 Latency::WS0
@@ -111,6 +110,8 @@ pub(crate) unsafe fn init(config: Config) {
111 } else { 110 } else {
112 Latency::WS2 111 Latency::WS2
113 }); 112 });
113 // the prefetch buffer is enabled by default, let's keep it enabled
114 w.set_prftbe(true);
114 }); 115 });
115 116
116 // the USB clock is only valid if an external crystal is used, the PLL is enabled, and the 117 // the USB clock is only valid if an external crystal is used, the PLL is enabled, and the