diff options
| author | xoviat <[email protected]> | 2023-10-23 16:26:34 -0500 |
|---|---|---|
| committer | xoviat <[email protected]> | 2023-10-23 16:26:34 -0500 |
| commit | df4aa0fe253252734dacd555364f5613044f7ecf (patch) | |
| tree | 8f11004719b10ce77475f0193b3ddc2c9bb8ba16 /embassy-stm32/src/rtc/mod.rs | |
| parent | e70c531d3d28565b6926d99d8e977c4df6c13c60 (diff) | |
stm32: fix low-power test
Diffstat (limited to 'embassy-stm32/src/rtc/mod.rs')
| -rw-r--r-- | embassy-stm32/src/rtc/mod.rs | 6 |
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 { | |||
| 184 | impl Rtc { | 184 | impl 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")] |
