stm32/rtc: remove rtc-debug and asbtract exti wakeup

This commit is contained in:
xoviat
2023-08-28 15:30:29 -05:00
parent 2c80784fe6
commit b315c28d4e
4 changed files with 10 additions and 31 deletions

View File

@ -75,21 +75,6 @@ impl super::Rtc {
/// start the wakeup alarm and wtih a duration that is as close to but less than
/// the requested duration, and record the instant the wakeup alarm was started
pub(crate) fn start_wakeup_alarm(&self, requested_duration: embassy_time::Duration) {
#[cfg(feature = "rtc-debug")]
if critical_section::with(|cs| {
if let Some(instant) = self.stop_time.borrow(cs).take() {
self.stop_time.borrow(cs).replace(Some(instant));
Some(())
} else {
None
}
})
.is_some()
{
return;
}
use embassy_time::{Duration, TICK_HZ};
use crate::rcc::get_freqs;
@ -133,6 +118,14 @@ impl super::Rtc {
critical_section::with(|cs| assert!(self.stop_time.borrow(cs).replace(Some(self.instant())).is_none()))
}
#[cfg(feature = "low-power")]
pub(crate) fn enable_wakeup_line(&self) {
use crate::pac::EXTI;
EXTI.rtsr(0).modify(|w| w.set_line(22, true));
EXTI.imr(0).modify(|w| w.set_line(22, true));
}
#[cfg(feature = "low-power")]
/// stop the wakeup alarm and return the time elapsed since `start_wakeup_alarm`
/// was called, otherwise none
@ -141,9 +134,6 @@ impl super::Rtc {
trace!("rtc: stop wakeup alarm at {}", self.instant());
#[cfg(feature = "rtc-debug")]
return None;
self.write(false, |regs| {
regs.cr().modify(|w| w.set_wutie(false));
regs.cr().modify(|w| w.set_wute(false));