Merge pull request #4276 from snakehand/main

Use modify() for subsequent changes to RCC.cr()
This commit is contained in:
Dario Nieuwenhuis 2025-06-03 14:03:23 +00:00 committed by GitHub
commit 1cfe047125
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -181,7 +181,7 @@ pub(crate) unsafe fn init(config: Config) {
w.set_msikrange(range); w.set_msikrange(range);
w.set_msirgsel(Msirgsel::ICSCR1); w.set_msirgsel(Msirgsel::ICSCR1);
}); });
RCC.cr().write(|w| { RCC.cr().modify(|w| {
w.set_msikon(true); w.set_msikon(true);
}); });
while !RCC.cr().read().msikrdy() {} while !RCC.cr().read().msikrdy() {}
@ -189,7 +189,7 @@ pub(crate) unsafe fn init(config: Config) {
}); });
let hsi = config.hsi.then(|| { let hsi = config.hsi.then(|| {
RCC.cr().write(|w| w.set_hsion(true)); RCC.cr().modify(|w| w.set_hsion(true));
while !RCC.cr().read().hsirdy() {} while !RCC.cr().read().hsirdy() {}
HSI_FREQ HSI_FREQ
@ -207,7 +207,7 @@ pub(crate) unsafe fn init(config: Config) {
} }
// Enable HSE, and wait for it to stabilize // Enable HSE, and wait for it to stabilize
RCC.cr().write(|w| { RCC.cr().modify(|w| {
w.set_hseon(true); w.set_hseon(true);
w.set_hsebyp(hse.mode != HseMode::Oscillator); w.set_hsebyp(hse.mode != HseMode::Oscillator);
w.set_hseext(match hse.mode { w.set_hseext(match hse.mode {