aboutsummaryrefslogtreecommitdiff
path: root/embassy-stm32/src/rtc/mod.rs
diff options
context:
space:
mode:
authorxoviat <[email protected]>2023-10-23 16:26:34 -0500
committerxoviat <[email protected]>2023-10-23 16:26:34 -0500
commitdf4aa0fe253252734dacd555364f5613044f7ecf (patch)
tree8f11004719b10ce77475f0193b3ddc2c9bb8ba16 /embassy-stm32/src/rtc/mod.rs
parente70c531d3d28565b6926d99d8e977c4df6c13c60 (diff)
stm32: fix low-power test
Diffstat (limited to 'embassy-stm32/src/rtc/mod.rs')
-rw-r--r--embassy-stm32/src/rtc/mod.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/embassy-stm32/src/rtc/mod.rs b/embassy-stm32/src/rtc/mod.rs
index 552dcc76f..d77443a9c 100644
--- a/embassy-stm32/src/rtc/mod.rs
+++ b/embassy-stm32/src/rtc/mod.rs
@@ -184,7 +184,11 @@ impl Default for RtcCalibrationCyclePeriod {
184impl Rtc { 184impl Rtc {
185 pub fn new(_rtc: impl Peripheral<P = RTC>, rtc_config: RtcConfig) -> Self { 185 pub fn new(_rtc: impl Peripheral<P = RTC>, rtc_config: RtcConfig) -> Self {
186 #[cfg(not(any(stm32l0, stm32f3, stm32l1, stm32f0, stm32f2)))] 186 #[cfg(not(any(stm32l0, stm32f3, stm32l1, stm32f0, stm32f2)))]
187 <RTC as crate::rcc::sealed::RccPeripheral>::enable_and_reset(); 187 critical_section::with(|cs| {
188 <RTC as crate::rcc::sealed::RccPeripheral>::enable_and_reset_with_cs(cs);
189 #[cfg(feature = "low-power")]
190 crate::rcc::clock_refcount_sub(cs);
191 });
188 192
189 let mut this = Self { 193 let mut this = Self {
190 #[cfg(feature = "low-power")] 194 #[cfg(feature = "low-power")]