WDT Example#

Overview#

This sample demonstrates the basic watchdog flow.

Source file:

src/rtsmart/examples/peripheral/wdt/test_wdt.c

Sample Behavior#

  • set timeout

  • start the watchdog

  • feed it periodically

  • either stop it or keep it running when the process exits

Key APIs#

  • wdt_set_timeout() / wdt_get_timeout()

  • wdt_start() / wdt_stop()

  • wdt_feed()

Build and Run#

cd src/rtsmart/examples/peripheral/wdt
make
./test_wdt <timeout_sec> [--no-stop]

Examples:

./test_wdt 5
./test_wdt 10 --no-stop
Comments list
Comments
Log in