diff options
| -rw-r--r-- | embassy-stm32/src/rcc/g4.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/embassy-stm32/src/rcc/g4.rs b/embassy-stm32/src/rcc/g4.rs index 6b1206c6a..3ba9e7eb0 100644 --- a/embassy-stm32/src/rcc/g4.rs +++ b/embassy-stm32/src/rcc/g4.rs | |||
| @@ -286,9 +286,8 @@ pub(crate) unsafe fn init(config: Config) { | |||
| 286 | assert!(freq <= 170_000_000); | 286 | assert!(freq <= 170_000_000); |
| 287 | 287 | ||
| 288 | if freq >= 150_000_000 { | 288 | if freq >= 150_000_000 { |
| 289 | // Enable Core Boost mode ([RM0440] p234) | 289 | // Enable Core Boost mode on freq >= 150Mhz ([RM0440] p234) |
| 290 | PWR.cr5() | 290 | PWR.cr5().modify(|w| w.set_r1mode(false)); |
| 291 | .modify(|w: &mut stm32_metapac::pwr::regs::Cr5| w.set_r1mode(false)); | ||
| 292 | // Set flash wait state in boost mode based on frequency ([RM0440] p191) | 291 | // Set flash wait state in boost mode based on frequency ([RM0440] p191) |
| 293 | if freq <= 36_000_000 { | 292 | if freq <= 36_000_000 { |
| 294 | FLASH.acr().modify(|w| w.set_latency(Latency::WS0)); | 293 | FLASH.acr().modify(|w| w.set_latency(Latency::WS0)); |
| @@ -302,8 +301,7 @@ pub(crate) unsafe fn init(config: Config) { | |||
| 302 | FLASH.acr().modify(|w| w.set_latency(Latency::WS4)); | 301 | FLASH.acr().modify(|w| w.set_latency(Latency::WS4)); |
| 303 | } | 302 | } |
| 304 | } else { | 303 | } else { |
| 305 | PWR.cr5() | 304 | PWR.cr5().modify(|w| w.set_r1mode(true)); |
| 306 | .modify(|w: &mut stm32_metapac::pwr::regs::Cr5| w.set_r1mode(true)); | ||
| 307 | // Set flash wait state in normal mode based on frequency ([RM0440] p191) | 305 | // Set flash wait state in normal mode based on frequency ([RM0440] p191) |
| 308 | if freq <= 30_000_000 { | 306 | if freq <= 30_000_000 { |
| 309 | FLASH.acr().modify(|w| w.set_latency(Latency::WS0)); | 307 | FLASH.acr().modify(|w| w.set_latency(Latency::WS0)); |
