stm32/rtc: use rccperi enable
This commit is contained in:
@@ -128,23 +128,6 @@ impl super::Rtc {
|
||||
impl sealed::Instance for crate::peripherals::RTC {
|
||||
const BACKUP_REGISTER_COUNT: usize = 32;
|
||||
|
||||
fn enable_peripheral_clk() {
|
||||
#[cfg(any(rcc_wle, rcc_wl5, rcc_g4))]
|
||||
{
|
||||
// enable peripheral clock for communication
|
||||
crate::pac::RCC.apb1enr1().modify(|w| w.set_rtcapben(true));
|
||||
}
|
||||
|
||||
#[cfg(rcc_g0)]
|
||||
{
|
||||
// enable peripheral clock for communication
|
||||
crate::pac::RCC.apbenr1().modify(|w| w.set_rtcapben(true));
|
||||
}
|
||||
|
||||
// read to allow the pwr clock to enable
|
||||
crate::pac::PWR.cr1().read();
|
||||
}
|
||||
|
||||
fn read_backup_register(_rtc: &Rtc, register: usize) -> Option<u32> {
|
||||
#[allow(clippy::if_same_then_else)]
|
||||
if register < Self::BACKUP_REGISTER_COUNT {
|
||||
|
||||
Reference in New Issue
Block a user