use rom linked functions for pin keeping

This commit is contained in:
2025-09-26 23:32:41 +02:00
parent 76f59b093d
commit f0bda32d7a
5 changed files with 32 additions and 10 deletions

View File

@@ -336,7 +336,7 @@ impl Esp<'_> {
}
pub(crate) fn clear_low_voltage_in_cycle(&mut self) {
unsafe {
LOW_VOLTAGE_DETECTED = 1;
LOW_VOLTAGE_DETECTED = 0;
}
}
@@ -547,7 +547,8 @@ impl Esp<'_> {
if duration_in_ms == 0 {
software_reset();
} else {
let timer = TimerWakeupSource::new(core::time::Duration::from_millis(duration_in_ms));
///let timer = TimerWakeupSource::new(core::time::Duration::from_millis(duration_in_ms));
let timer = TimerWakeupSource::new(core::time::Duration::from_millis(5000));
let mut wake_pins: [(&mut dyn RtcPinWithResistors, WakeupLevel); 1] = [(&mut self.wake_gpio1, WakeupLevel::Low)];
let ext1 = esp_hal::rtc_cntl::sleep::Ext1WakeupSource::new(&mut wake_pins);
rtc.sleep_deep(&[&timer, &ext1]);