This provides a basic Watchdog service, and includes a startup detection to determine if the reset was caused by the WD.
Dependents: A_CANAdapter LeonardoMbos AVC_2012 RT_CAN ... more
Using this Watchdog Class
#include "Watchdog.h" Watchdog wd; ... void main() { if (wd.WatchdogCausedReset()) pc.printf("Watchdog caused reset.\r\n"); wd.Configure(3.0); // sets the timeout interval for (;;) { wd.Service(); // kick the dog before the timeout // do other work } }
Revision 3:5959d3d35221, committed 2014-10-04
- Comitter:
- WiredHome
- Date:
- Sat Oct 04 17:58:04 2014 +0000
- Parent:
- 2:2873f068f325
- Child:
- 4:22c5c4aa4661
- Commit message:
- No code change, trying to force an update to the documentation to properly show the wd.service api.
Changed in this revision
Watchdog.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/Watchdog.cpp Thu Jun 16 20:55:38 2011 +0000 +++ b/Watchdog.cpp Sat Oct 04 17:58:04 2014 +0000 @@ -16,7 +16,6 @@ #include "Watchdog.h" - /// Watchdog gets instantiated at the module level Watchdog::Watchdog() { wdreset = (LPC_WDT->WDMOD >> 2) & 1; // capture the cause of the previous reset