Merge pull request #1934 from chrenderle/low-power-l0

fix low-power: APB1 needed for LSE
This commit is contained in:
xoviat 2023-09-21 17:40:11 +00:00 committed by GitHub
commit e313ca4ae8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -88,6 +88,11 @@ impl BackupDomain {
))] ))]
#[allow(dead_code, unused_variables)] #[allow(dead_code, unused_variables)]
pub fn configure_ls(clock_source: RtcClockSource, lsi: bool, lse: Option<LseDrive>) { pub fn configure_ls(clock_source: RtcClockSource, lsi: bool, lse: Option<LseDrive>) {
if lsi || lse.is_some() {
use crate::rtc::sealed::Instance;
crate::peripherals::RTC::enable_peripheral_clk();
}
if lsi { if lsi {
#[cfg(rtc_v3u5)] #[cfg(rtc_v3u5)]
let csr = crate::pac::RCC.bdcr(); let csr = crate::pac::RCC.bdcr();

View File

@ -154,8 +154,6 @@ impl Default for RtcCalibrationCyclePeriod {
impl Rtc { impl Rtc {
pub fn new(_rtc: impl Peripheral<P = RTC>, rtc_config: RtcConfig) -> Self { pub fn new(_rtc: impl Peripheral<P = RTC>, rtc_config: RtcConfig) -> Self {
RTC::enable_peripheral_clk();
let mut this = Self { let mut this = Self {
#[cfg(feature = "low-power")] #[cfg(feature = "low-power")]
stop_time: Mutex::const_new(CriticalSectionRawMutex::new(), Cell::new(None)), stop_time: Mutex::const_new(CriticalSectionRawMutex::new(), Cell::new(None)),