stm32: fix low-power test

This commit is contained in:
xoviat
2023-10-23 16:26:34 -05:00
parent e70c531d3d
commit df4aa0fe25
3 changed files with 25 additions and 8 deletions

View File

@ -184,7 +184,11 @@ impl Default for RtcCalibrationCyclePeriod {
impl Rtc {
pub fn new(_rtc: impl Peripheral<P = RTC>, rtc_config: RtcConfig) -> Self {
#[cfg(not(any(stm32l0, stm32f3, stm32l1, stm32f0, stm32f2)))]
<RTC as crate::rcc::sealed::RccPeripheral>::enable_and_reset();
critical_section::with(|cs| {
<RTC as crate::rcc::sealed::RccPeripheral>::enable_and_reset_with_cs(cs);
#[cfg(feature = "low-power")]
crate::rcc::clock_refcount_sub(cs);
});
let mut this = Self {
#[cfg(feature = "low-power")]