diff options
| author | Dario Nieuwenhuis <[email protected]> | 2025-06-03 14:03:23 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-06-03 14:03:23 +0000 |
| commit | 1cfe04712587048650c753cda25bce2d16831b11 (patch) | |
| tree | 8e74ecb4255216c049cbaa1de8564df8e9cf44e2 | |
| parent | c637ee7d79552d9b9bfa0c0f4199372975acc343 (diff) | |
| parent | 011d7832f899a1cc836bed5d4dbb80863b774e6c (diff) | |
Merge pull request #4276 from snakehand/main
Use modify() for subsequent changes to RCC.cr()
| -rw-r--r-- | embassy-stm32/src/rcc/u5.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/embassy-stm32/src/rcc/u5.rs b/embassy-stm32/src/rcc/u5.rs index ff70466b9..97eb2eb6d 100644 --- a/embassy-stm32/src/rcc/u5.rs +++ b/embassy-stm32/src/rcc/u5.rs | |||
| @@ -181,7 +181,7 @@ pub(crate) unsafe fn init(config: Config) { | |||
| 181 | w.set_msikrange(range); | 181 | w.set_msikrange(range); |
| 182 | w.set_msirgsel(Msirgsel::ICSCR1); | 182 | w.set_msirgsel(Msirgsel::ICSCR1); |
| 183 | }); | 183 | }); |
| 184 | RCC.cr().write(|w| { | 184 | RCC.cr().modify(|w| { |
| 185 | w.set_msikon(true); | 185 | w.set_msikon(true); |
| 186 | }); | 186 | }); |
| 187 | while !RCC.cr().read().msikrdy() {} | 187 | while !RCC.cr().read().msikrdy() {} |
| @@ -189,7 +189,7 @@ pub(crate) unsafe fn init(config: Config) { | |||
| 189 | }); | 189 | }); |
| 190 | 190 | ||
| 191 | let hsi = config.hsi.then(|| { | 191 | let hsi = config.hsi.then(|| { |
| 192 | RCC.cr().write(|w| w.set_hsion(true)); | 192 | RCC.cr().modify(|w| w.set_hsion(true)); |
| 193 | while !RCC.cr().read().hsirdy() {} | 193 | while !RCC.cr().read().hsirdy() {} |
| 194 | 194 | ||
| 195 | HSI_FREQ | 195 | HSI_FREQ |
| @@ -207,7 +207,7 @@ pub(crate) unsafe fn init(config: Config) { | |||
| 207 | } | 207 | } |
| 208 | 208 | ||
| 209 | // Enable HSE, and wait for it to stabilize | 209 | // Enable HSE, and wait for it to stabilize |
| 210 | RCC.cr().write(|w| { | 210 | RCC.cr().modify(|w| { |
| 211 | w.set_hseon(true); | 211 | w.set_hseon(true); |
| 212 | w.set_hsebyp(hse.mode != HseMode::Oscillator); | 212 | w.set_hsebyp(hse.mode != HseMode::Oscillator); |
| 213 | w.set_hseext(match hse.mode { | 213 | w.set_hseext(match hse.mode { |
