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:
1:5a1ff72b5915
Parent:
0:7a316f14da9c
Child:
2:2873f068f325
--- a/Watchdog.h	Sun Mar 20 23:22:50 2011 +0000
+++ b/Watchdog.h	Sun Mar 20 23:24:36 2011 +0000
@@ -29,7 +29,7 @@
 ///      
 ///    wd.Configure(30.0);      // sets the timeout interval
 ///    for (;;) {
-///         wd.Service;       // kick the dog before the timeout
+///         wd.Service();       // kick the dog before the timeout
 /// @endcode
 ///
 class Watchdog {
@@ -61,6 +61,10 @@
     
     /// Service the Watchdog so it does not cause a system reset
     ///
+    /// example:
+    /// @code
+    ///    wd.Service();
+    /// @endcode
     /// @returns none
     void Service();