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:
6:e0f547e22dd5
Parent:
5:2dad2a78ffbd
--- a/Watchdog.h	Mon Mar 16 01:00:03 2015 +0000
+++ b/Watchdog.h	Mon Mar 16 01:04:32 2015 +0000
@@ -8,7 +8,7 @@
 /// 
 /// Adapted from Simon's Watchdog code from http://mbed.org/forum/mbed/topic/508/
 ///
-/// @note Copyright © 2011 by Smartware Computing, all rights reserved.
+/// @note Copyright © 2011,2015 by Smartware Computing, all rights reserved.
 ///     This software may be used to derive new software, as long as
 ///     this copyright statement remains in the source file.
 /// @author David Smart