pub trait WatchDog {
// Provided methods
fn setup(&self) { ... }
fn tickle(&self) { ... }
fn suspend(&self) { ... }
fn resume(&self) { ... }
}
Expand description
A trait for implementing a watchdog in the kernel.
This trait is called from the kernel_loop()
code to setup
and maintain the watchdog timer.
It is up to the specific Chip
how it will handle watchdog interrupts.
Provided Methods§
sourcefn setup(&self)
fn setup(&self)
This function must enable the watchdog timer and configure it to trigger regulary. The period of the timer is left to the implementation to decide. The implementation must ensure that it doesn’t trigger too early (when we haven’t hung for example) or too late as to not catch faults. After calling this function the watchdog must be running.
sourcefn tickle(&self)
fn tickle(&self)
This function must tickle the watchdog to reset the timer. If the watchdog was previously suspended then this should also resume the timer.
Implementations on Foreign Types§
impl WatchDog for ()
Implement default WatchDog trait for unit.