Module esp_idf_svc::hal::task::watchdog

source ·
Expand description

§Example

let peripherals = Peripherals::take().unwrap();

let config = TWDTConfig {
    duration: Duration::from_secs(2),
    panic_on_trigger: true,
    subscribed_idle_tasks: enum_set!(Core::Core0)
};
let mut driver = esp_idf_hal::task::watchdog::TWDTDriver::new(
    peripherals.twdt,
    &config,
)?;

let mut watchdog = driver.watch_current_task()?;

loop {
    watchdog.feed();
    unsafe { vTaskDelay(1) };
}

Modules§

Structs§

Type Aliases§