main: configure hardware watchdogs to be petted faster than they expire
This commit is contained in:
@@ -80,7 +80,7 @@ async fn main(spawner: Spawner) {
|
||||
let safety_ui = SafetyUi::new(&mut safety_surfaces, garage.display.clone());
|
||||
|
||||
let mut wdt = timer0.wdt;
|
||||
wdt.set_timeout(esp_hal::timer::timg::MwdtStage::Stage0, esp_hal::time::Duration::from_secs(3));
|
||||
wdt.set_timeout(esp_hal::timer::timg::MwdtStage::Stage0, esp_hal::time::Duration::from_secs(5));
|
||||
let swi = SoftwareInterruptControl::new(peripherals.SW_INTERRUPT);
|
||||
let hi_exec = STATIC_HI_EXEC.init(InterruptExecutor::new(swi.software_interrupt0));
|
||||
let hi_spawn = hi_exec.start(esp_hal::interrupt::Priority::max());
|
||||
@@ -186,6 +186,6 @@ async fn wdt_task(mut wdt: Wdt<esp_hal::peripherals::TIMG1<'static>>) {
|
||||
// Watchdog is set to trip after 5 seconds, so we wait just long enough before it trips
|
||||
// TODO: We should maybe extend this timeout to 30s or 1m when the system is sleeping
|
||||
wdt.feed();
|
||||
Timer::after_secs(5).await;
|
||||
Timer::after_secs(3).await;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user