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
   }
}

Files at this revision

API Documentation at this revision

Comitter:
WiredHome
Date:
Mon Mar 16 01:04:32 2015 +0000
Parent:
5:2dad2a78ffbd
Commit message:
Enhanced the description for the library to indicate target support.

Changed in this revision

Watchdog.h Show annotated file Show diff for this revision Revisions of this file
diff -r 2dad2a78ffbd -r e0f547e22dd5 Watchdog.h
--- 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