diff options
| author | xoviat <[email protected]> | 2023-09-25 16:27:08 -0500 |
|---|---|---|
| committer | xoviat <[email protected]> | 2023-09-25 16:27:08 -0500 |
| commit | dc400a05393fa9765a9ecb91cbbec10300a5e238 (patch) | |
| tree | 1e308b0dea1ffa0026262d1e50250e6d4ecc51aa /embassy-stm32/src/rtc/v2.rs | |
| parent | 04b09a2acb465dbb87dfc4e8b24b4c587f21b472 (diff) | |
stm32/rtc: always set wakeup alarm
Diffstat (limited to 'embassy-stm32/src/rtc/v2.rs')
| -rw-r--r-- | embassy-stm32/src/rtc/v2.rs | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/embassy-stm32/src/rtc/v2.rs b/embassy-stm32/src/rtc/v2.rs index 331792a04..4608d3114 100644 --- a/embassy-stm32/src/rtc/v2.rs +++ b/embassy-stm32/src/rtc/v2.rs | |||
| @@ -75,15 +75,6 @@ impl super::Rtc { | |||
| 75 | #[cfg(any(rcc_wb, rcc_f4, rcc_f410))] | 75 | #[cfg(any(rcc_wb, rcc_f4, rcc_f410))] |
| 76 | unsafe { crate::rcc::get_freqs() }.rtc.unwrap(); | 76 | unsafe { crate::rcc::get_freqs() }.rtc.unwrap(); |
| 77 | 77 | ||
| 78 | /* | ||
| 79 | If the requested duration is u64::MAX, don't even set the alarm | ||
| 80 | |||
| 81 | Otherwise clamp the requested duration to u32::MAX so that we can do math | ||
| 82 | */ | ||
| 83 | if requested_duration.as_ticks() == u64::MAX { | ||
| 84 | return; | ||
| 85 | } | ||
| 86 | |||
| 87 | let requested_duration = requested_duration.as_ticks().clamp(0, u32::MAX as u64); | 78 | let requested_duration = requested_duration.as_ticks().clamp(0, u32::MAX as u64); |
| 88 | let rtc_hz = Self::frequency().0 as u64; | 79 | let rtc_hz = Self::frequency().0 as u64; |
| 89 | let rtc_ticks = requested_duration * rtc_hz / TICK_HZ; | 80 | let rtc_ticks = requested_duration * rtc_hz / TICK_HZ; |
