Merge pull request #1721 from MabezDev/rtc-f2-dont-reset-bd

stm32f2: Avoid resetting RTC backup domain
This commit is contained in:
Dario Nieuwenhuis 2023-07-30 20:26:27 +00:00 committed by GitHub
commit 3c3a1d89b5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -39,9 +39,8 @@ impl<'d, T: Instance> super::Rtc<'d, T> {
let rtcsel = reg.rtcsel().to_bits();
if !reg.rtcen() || rtcsel != clock_config {
#[cfg(not(any(rtc_v2l0, rtc_v2l1)))]
#[cfg(not(any(rtc_v2l0, rtc_v2l1, rtc_v2f2)))]
crate::pac::RCC.bdcr().modify(|w| w.set_bdrst(true));
#[cfg(not(any(rtc_v2l0, rtc_v2l1)))]
let cr = crate::pac::RCC.bdcr();
#[cfg(any(rtc_v2l0, rtc_v2l1))]
@ -201,6 +200,11 @@ impl sealed::Instance for crate::peripherals::RTC {
// read to allow the pwr clock to enable
crate::pac::PWR.cr1().read();
}
#[cfg(any(rtc_v2f2))]
{
crate::pac::RCC.apb1enr().modify(|w| w.set_pwren(true));
crate::pac::PWR.cr().read();
}
}
fn read_backup_register(rtc: &Rtc, register: usize) -> Option<u32> {