Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions embedded-mcu-hal/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ pub mod time;
/// Traits for NVRAM (Non-Volatile Random Access Memory) storage and management.
mod nvram;
pub use nvram::{Nvram, NvramStorage};

pub mod watchdog;
13 changes: 13 additions & 0 deletions embedded-mcu-hal/src/watchdog.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//! Traits for interactions with a processor's watchdog timer.
/// Feeds an existing watchdog to ensure the processor isn't reset.
pub trait Watchdog: Send {
/// An enumeration of `Watchdog` errors.
///
type Error: core::fmt::Debug;

/// Restarts the countdown on the watchdog. This must be done once the watchdog is started
/// to prevent the processor being reset.
///
fn feed(&mut self) -> Result<(), Self::Error>;
}
Loading