Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: EALib EthernetInterface_vz mbed-rtos mbed
Fork of header_main_colinas_V0-20-09-14 by
Diff: wdt.h
- Revision:
- 17:67a6b557eda5
- Child:
- 33:735fd60e96d8
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/wdt.h Fri Sep 19 16:40:17 2014 +0000
@@ -0,0 +1,58 @@
+#ifndef _WDT_H
+#define _WDT_H
+#include "mbed.h"
+
+class Watchdog {
+public:
+ /// Create a Watchdog object
+ ///
+ /// example:
+ /// @code
+ /// Watchdog wd; // placed before main
+ /// @endcode
+ Watchdog();
+
+ /// Configure the timeout for the Watchdog
+ ///
+ /// This configures the Watchdog service and starts it. It must
+ /// be serviced before the timeout, or the system will be restarted.
+ ///
+ /// example:
+ /// @code
+ /// ...
+ /// wd.Configure(1.4); // configure for a 1.4 second timeout
+ /// ...
+ /// @endcode
+ ///
+ /// @param timeout in seconds, as a floating point number
+ /// @returns none
+ ///
+ void Configure(float timeout);
+
+ /// Service the Watchdog so it does not cause a system reset
+ ///
+ /// example:
+ /// @code
+ /// wd.Service();
+ /// @endcode
+ /// @returns none
+ void kick();
+
+ /// WatchdogCausedReset identifies if the cause of the system
+ /// reset was the Watchdog
+ ///
+ /// example:
+ /// @code
+ /// if (wd.WatchdogCausedReset())) {
+ /// @endcode
+ ///
+ /// @returns true if the Watchdog was the cause of the reset
+ bool WatchdogCausedReset();
+private:
+ bool wdreset;
+};
+
+
+
+
+#endif
