stm32/rcc: set rtc clock on f4
This commit is contained in:
parent
f723982bec
commit
8c12453544
@ -473,6 +473,11 @@ pub(crate) unsafe fn init(config: Config) {
|
|||||||
Rtc::set_clock_source(clock_source);
|
Rtc::set_clock_source(clock_source);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
let rtc = match config.rtc {
|
||||||
|
Some(RtcClockSource::LSI) => Some(LSI_FREQ),
|
||||||
|
_ => None,
|
||||||
|
};
|
||||||
|
|
||||||
set_freqs(Clocks {
|
set_freqs(Clocks {
|
||||||
sys: Hertz(sysclk),
|
sys: Hertz(sysclk),
|
||||||
apb1: Hertz(pclk1),
|
apb1: Hertz(pclk1),
|
||||||
@ -492,6 +497,8 @@ pub(crate) unsafe fn init(config: Config) {
|
|||||||
|
|
||||||
#[cfg(any(stm32f427, stm32f429, stm32f437, stm32f439, stm32f446, stm32f469, stm32f479))]
|
#[cfg(any(stm32f427, stm32f429, stm32f437, stm32f439, stm32f446, stm32f469, stm32f479))]
|
||||||
pllsai: None,
|
pllsai: None,
|
||||||
|
|
||||||
|
rtc: rtc,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -74,7 +74,7 @@ pub struct Clocks {
|
|||||||
#[cfg(any(rcc_h5, rcc_h50, rcc_h7, rcc_h7ab))]
|
#[cfg(any(rcc_h5, rcc_h50, rcc_h7, rcc_h7ab))]
|
||||||
pub adc: Option<Hertz>,
|
pub adc: Option<Hertz>,
|
||||||
|
|
||||||
#[cfg(rcc_wb)]
|
#[cfg(any(rcc_wb, rcc_f4))]
|
||||||
/// Set only if the lsi or lse is configured
|
/// Set only if the lsi or lse is configured
|
||||||
pub rtc: Option<Hertz>,
|
pub rtc: Option<Hertz>,
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user