Note

This is the documentation for the latest development branch and may refer to features that are not available in released versions. If you are looking for the documentation for a specific release, use the drop-down menu on the left and select the desired version.

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