voltando a versao de n aberturas e fechamentos de sockets data 19/09
Dependencies: EthernetInterface NTPClient mbed-rtos mbed EALib
Fork of header_main_publish by
wdt.h@19:ab2088e0dec6, 2014-09-20 (annotated)
- Committer:
- klauss
- Date:
- Sat Sep 20 11:27:47 2014 +0000
- Revision:
- 19:ab2088e0dec6
- Parent:
- 17:67a6b557eda5
colinas_02
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
klauss | 17:67a6b557eda5 | 1 | #ifndef _WDT_H |
klauss | 17:67a6b557eda5 | 2 | #define _WDT_H |
klauss | 17:67a6b557eda5 | 3 | #include "mbed.h" |
klauss | 17:67a6b557eda5 | 4 | |
klauss | 17:67a6b557eda5 | 5 | class Watchdog { |
klauss | 17:67a6b557eda5 | 6 | public: |
klauss | 17:67a6b557eda5 | 7 | /// Create a Watchdog object |
klauss | 17:67a6b557eda5 | 8 | /// |
klauss | 17:67a6b557eda5 | 9 | /// example: |
klauss | 17:67a6b557eda5 | 10 | /// @code |
klauss | 17:67a6b557eda5 | 11 | /// Watchdog wd; // placed before main |
klauss | 17:67a6b557eda5 | 12 | /// @endcode |
klauss | 17:67a6b557eda5 | 13 | Watchdog(); |
klauss | 17:67a6b557eda5 | 14 | |
klauss | 17:67a6b557eda5 | 15 | /// Configure the timeout for the Watchdog |
klauss | 17:67a6b557eda5 | 16 | /// |
klauss | 17:67a6b557eda5 | 17 | /// This configures the Watchdog service and starts it. It must |
klauss | 17:67a6b557eda5 | 18 | /// be serviced before the timeout, or the system will be restarted. |
klauss | 17:67a6b557eda5 | 19 | /// |
klauss | 17:67a6b557eda5 | 20 | /// example: |
klauss | 17:67a6b557eda5 | 21 | /// @code |
klauss | 17:67a6b557eda5 | 22 | /// ... |
klauss | 17:67a6b557eda5 | 23 | /// wd.Configure(1.4); // configure for a 1.4 second timeout |
klauss | 17:67a6b557eda5 | 24 | /// ... |
klauss | 17:67a6b557eda5 | 25 | /// @endcode |
klauss | 17:67a6b557eda5 | 26 | /// |
klauss | 17:67a6b557eda5 | 27 | /// @param timeout in seconds, as a floating point number |
klauss | 17:67a6b557eda5 | 28 | /// @returns none |
klauss | 17:67a6b557eda5 | 29 | /// |
klauss | 17:67a6b557eda5 | 30 | void Configure(float timeout); |
klauss | 17:67a6b557eda5 | 31 | |
klauss | 17:67a6b557eda5 | 32 | /// Service the Watchdog so it does not cause a system reset |
klauss | 17:67a6b557eda5 | 33 | /// |
klauss | 17:67a6b557eda5 | 34 | /// example: |
klauss | 17:67a6b557eda5 | 35 | /// @code |
klauss | 17:67a6b557eda5 | 36 | /// wd.Service(); |
klauss | 17:67a6b557eda5 | 37 | /// @endcode |
klauss | 17:67a6b557eda5 | 38 | /// @returns none |
klauss | 17:67a6b557eda5 | 39 | void kick(); |
klauss | 17:67a6b557eda5 | 40 | |
klauss | 17:67a6b557eda5 | 41 | /// WatchdogCausedReset identifies if the cause of the system |
klauss | 17:67a6b557eda5 | 42 | /// reset was the Watchdog |
klauss | 17:67a6b557eda5 | 43 | /// |
klauss | 17:67a6b557eda5 | 44 | /// example: |
klauss | 17:67a6b557eda5 | 45 | /// @code |
klauss | 17:67a6b557eda5 | 46 | /// if (wd.WatchdogCausedReset())) { |
klauss | 17:67a6b557eda5 | 47 | /// @endcode |
klauss | 17:67a6b557eda5 | 48 | /// |
klauss | 17:67a6b557eda5 | 49 | /// @returns true if the Watchdog was the cause of the reset |
klauss | 17:67a6b557eda5 | 50 | bool WatchdogCausedReset(); |
klauss | 17:67a6b557eda5 | 51 | private: |
klauss | 17:67a6b557eda5 | 52 | bool wdreset; |
klauss | 17:67a6b557eda5 | 53 | }; |
klauss | 17:67a6b557eda5 | 54 | |
klauss | 17:67a6b557eda5 | 55 | |
klauss | 17:67a6b557eda5 | 56 | |
klauss | 17:67a6b557eda5 | 57 | |
klauss | 17:67a6b557eda5 | 58 | #endif |