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 } }
Diff: Watchdog.h
- Revision:
- 5:2dad2a78ffbd
- Parent:
- 4:22c5c4aa4661
- Child:
- 6:e0f547e22dd5
diff -r 22c5c4aa4661 -r 2dad2a78ffbd Watchdog.h --- a/Watchdog.h Sat Oct 11 17:28:07 2014 +0000 +++ b/Watchdog.h Mon Mar 16 01:00:03 2015 +0000 @@ -14,6 +14,7 @@ /// @author David Smart /// /// History +/// \li v2.00 - 20150315: Enhanced beyond TARGET_LPC1768 to TARGET_LPC4088, TARGET_STM /// \li v1.00 - 20110616: initial release with some documentation improvements /// #ifndef WATCHDOG_H @@ -31,6 +32,11 @@ /// however this one also provides a method for the application software /// to determine the cause of the reset - watchdog or otherwise. /// +/// Supports: +/// \li TARGET_LPC1768 +/// \li TARGET_LPC4088 +/// \li TARGET_STM +/// /// example: /// @code /// Watchdog wd;