diff options
| author | xoviat <[email protected]> | 2025-11-04 13:05:49 -0600 |
|---|---|---|
| committer | xoviat <[email protected]> | 2025-11-04 13:05:49 -0600 |
| commit | f53357539a677016b0e6dfdc3335cf6fd187b129 (patch) | |
| tree | da41799fac427d9be1899ca8931194b0ecdd1fed /embassy-stm32/src/rtc | |
| parent | 74c9e57be4df4da74430fd97cb034fd98599343a (diff) | |
fix rtc opt
Diffstat (limited to 'embassy-stm32/src/rtc')
| -rw-r--r-- | embassy-stm32/src/rtc/mod.rs | 11 |
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")] |
| 338 | pub(crate) fn init_rtc(_cs: CriticalSection, config: RtcConfig) { | 337 | pub(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 | } |
