aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--embassy-stm32/src/rtc/mod.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/embassy-stm32/src/rtc/mod.rs b/embassy-stm32/src/rtc/mod.rs
index 2c25e1e36..29e77ccc0 100644
--- a/embassy-stm32/src/rtc/mod.rs
+++ b/embassy-stm32/src/rtc/mod.rs
@@ -157,10 +157,10 @@ impl Rtc {
157 #[cfg(not(feature = "low-power"))] 157 #[cfg(not(feature = "low-power"))]
158 /// Create a new RTC instance. 158 /// Create a new RTC instance.
159 pub fn new(_rtc: Peri<'static, RTC>, rtc_config: RtcConfig) -> Self { 159 pub fn new(_rtc: Peri<'static, RTC>, rtc_config: RtcConfig) -> Self {
160 Self::new_inner(rtc_config, false) 160 Self::new_inner(rtc_config)
161 } 161 }
162 162
163 pub(self) fn new_inner(rtc_config: RtcConfig, enable_wakeup_line: bool) -> Self { 163 pub(self) fn new_inner(rtc_config: RtcConfig) -> Self {
164 #[cfg(not(any(stm32l0, stm32f3, stm32l1, stm32f0, stm32f2)))] 164 #[cfg(not(any(stm32l0, stm32f3, stm32l1, stm32f0, stm32f2)))]
165 crate::rcc::enable_and_reset::<RTC>(); 165 crate::rcc::enable_and_reset::<RTC>();
166 166
@@ -183,9 +183,8 @@ impl Rtc {
183 while now == this.time_provider().read(|_, _, ss| Ok(ss)).unwrap() {} 183 while now == this.time_provider().read(|_, _, ss| Ok(ss)).unwrap() {}
184 } 184 }
185 185
186 if enable_wakeup_line { 186 #[cfg(feature = "low-power")]
187 this.enable_wakeup_line(); 187 this.enable_wakeup_line();
188 }
189 188
190 this 189 this
191 } 190 }
@@ -336,7 +335,7 @@ trait SealedInstance {
336 335
337#[cfg(feature = "low-power")] 336#[cfg(feature = "low-power")]
338pub(crate) fn init_rtc(_cs: CriticalSection, config: RtcConfig) { 337pub(crate) fn init_rtc(_cs: CriticalSection, config: RtcConfig) {
339 crate::time_driver::get_driver().set_rtc(Rtc::new_inner(config, true)); 338 crate::time_driver::get_driver().set_rtc(Rtc::new_inner(config));
340 339
341 trace!("low power: stop with rtc configured"); 340 trace!("low power: stop with rtc configured");
342} 341}