stm32: fix bd lsi

This commit is contained in:
xoviat 2023-09-24 18:37:09 -05:00
parent 65d36f9f99
commit 9f2fc04caa

View File

@ -100,13 +100,14 @@ impl BackupDomain {
#[cfg(not(rtc_v3u5))] #[cfg(not(rtc_v3u5))]
let csr = crate::pac::RCC.csr(); let csr = crate::pac::RCC.csr();
Self::modify(|_| { // Disable backup domain write protection
#[cfg(not(any(rcc_wb, rcc_wba)))] Self::modify(|_| {});
csr.modify(|w| w.set_lsion(true));
#[cfg(any(rcc_wb, rcc_wba))] #[cfg(not(any(rcc_wb, rcc_wba)))]
csr.modify(|w| w.set_lsi1on(true)); csr.modify(|w| w.set_lsion(true));
});
#[cfg(any(rcc_wb, rcc_wba))]
csr.modify(|w| w.set_lsi1on(true));
#[cfg(not(any(rcc_wb, rcc_wba)))] #[cfg(not(any(rcc_wb, rcc_wba)))]
while !csr.read().lsirdy() {} while !csr.read().lsirdy() {}