diff options
| -rw-r--r-- | embassy-stm32/src/rtc/v2.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/embassy-stm32/src/rtc/v2.rs b/embassy-stm32/src/rtc/v2.rs index a2eace6d3..e3b9dfb8b 100644 --- a/embassy-stm32/src/rtc/v2.rs +++ b/embassy-stm32/src/rtc/v2.rs | |||
| @@ -39,9 +39,8 @@ impl<'d, T: Instance> super::Rtc<'d, T> { | |||
| 39 | let rtcsel = reg.rtcsel().to_bits(); | 39 | let rtcsel = reg.rtcsel().to_bits(); |
| 40 | 40 | ||
| 41 | if !reg.rtcen() || rtcsel != clock_config { | 41 | if !reg.rtcen() || rtcsel != clock_config { |
| 42 | #[cfg(not(any(rtc_v2l0, rtc_v2l1)))] | 42 | #[cfg(not(any(rtc_v2l0, rtc_v2l1, rtc_v2f2)))] |
| 43 | crate::pac::RCC.bdcr().modify(|w| w.set_bdrst(true)); | 43 | crate::pac::RCC.bdcr().modify(|w| w.set_bdrst(true)); |
| 44 | |||
| 45 | #[cfg(not(any(rtc_v2l0, rtc_v2l1)))] | 44 | #[cfg(not(any(rtc_v2l0, rtc_v2l1)))] |
| 46 | let cr = crate::pac::RCC.bdcr(); | 45 | let cr = crate::pac::RCC.bdcr(); |
| 47 | #[cfg(any(rtc_v2l0, rtc_v2l1))] | 46 | #[cfg(any(rtc_v2l0, rtc_v2l1))] |
| @@ -201,6 +200,11 @@ impl sealed::Instance for crate::peripherals::RTC { | |||
| 201 | // read to allow the pwr clock to enable | 200 | // read to allow the pwr clock to enable |
| 202 | crate::pac::PWR.cr1().read(); | 201 | crate::pac::PWR.cr1().read(); |
| 203 | } | 202 | } |
| 203 | #[cfg(any(rtc_v2f2))] | ||
| 204 | { | ||
| 205 | crate::pac::RCC.apb1enr().modify(|w| w.set_pwren(true)); | ||
| 206 | crate::pac::PWR.cr().read(); | ||
| 207 | } | ||
| 204 | } | 208 | } |
| 205 | 209 | ||
| 206 | fn read_backup_register(rtc: &Rtc, register: usize) -> Option<u32> { | 210 | fn read_backup_register(rtc: &Rtc, register: usize) -> Option<u32> { |
