Skip to main content

Crate mwdg

Crate mwdg 

Source
Expand description

§mwdg - Micro-Watchdog Library

A no_std software multi-watchdog library for embedded RTOS systems.

Each RTOS task registers a mwdg_node with a timeout interval. The task periodically calls mwdg_feed to signal liveness. A central mwdg_check function verifies all registered watchdogs are healthy, enabling the main loop to gate hardware watchdog resets.

§C FFI

All public functions declared to be exposed without mangling, so the library can be linked from C/C++ code. Use the generated include/mwdg.h header for having proper interface declaration.

A user of the library must provide the following functions that the library uses to get system timestamp in milliseconds, enter/exit critical sections.

extern uint32_t mwdg_get_time_milliseconds(void);
extern void mwdg_enter_critical(void);
extern void mwdg_exit_critical(void);

Structs§

mwdg_node
A single software watchdog node.

Functions§

mwdg_add
Register a software watchdog with the given timeout.
mwdg_assign_id
Assign a user-chosen identifier to a watchdog node.
mwdg_check
Check all registered watchdogs for expiration.
mwdg_feed
Feed (touch) a watchdog, resetting its timestamp to the current time.
mwdg_get_next_expired
Iterate over registered watchdogs and find the next expired one.
mwdg_init
Initialize the multi-watchdog subsystem.
mwdg_remove
Remove a previously registered watchdog from the global list.