diff options
| author | Dario Nieuwenhuis <[email protected]> | 2023-10-17 00:29:30 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-10-17 00:29:30 +0000 |
| commit | 3e3317e8bd4a0c11655fb48a4bcff77791c105bc (patch) | |
| tree | b0e7170fb445b24be9213493025251f837c6da40 | |
| parent | 7fd868ade91ebd92cf68016cd40cbbad30a5918e (diff) | |
| parent | e7aeb9b29feaf2ca4bf3ac2cac47583cd9468e88 (diff) | |
Merge pull request #2078 from GrantM11235/prefetch
stm32f1: Keep flash prefetch enabled
| -rw-r--r-- | embassy-stm32/src/rcc/f1.rs | 3 |
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 |
