Modularizando o src
Dependencies: EALib EthernetInterface_vz mbed-rtos mbed
Fork of header_main_colinas_V0-20-09-14 by
wdt.h@137:32dd35a6dbc9, 2015-11-24 (annotated)
- Committer:
- klauss
- Date:
- Tue Nov 24 14:06:22 2015 +0000
- Revision:
- 137:32dd35a6dbc9
- Parent:
- 121:ee02790d00b7
core source of the .bin (09/21/2015) in the field
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
klauss | 69:65665afbad5d | 1 | /** |
klauss | 69:65665afbad5d | 2 | * @file wdt.h |
klauss | 69:65665afbad5d | 3 | * @Synopsis Implementa funcionalidade de watchdog |
klauss | 69:65665afbad5d | 4 | * @author Imported from MBED |
klauss | 69:65665afbad5d | 5 | * @version 1 |
klauss | 69:65665afbad5d | 6 | * @date 2014-11-06 |
klauss | 69:65665afbad5d | 7 | */ |
klauss | 121:ee02790d00b7 | 8 | #ifndef __WDT_H__ |
klauss | 121:ee02790d00b7 | 9 | #define __WDT_H__ |
klauss | 121:ee02790d00b7 | 10 | |
klauss | 121:ee02790d00b7 | 11 | #include "EthernetInterface.h" |
klauss | 17:67a6b557eda5 | 12 | #include "mbed.h" |
klauss | 121:ee02790d00b7 | 13 | #include <stdint.h> |
klauss | 17:67a6b557eda5 | 14 | |
klauss | 17:67a6b557eda5 | 15 | class Watchdog { |
klauss | 17:67a6b557eda5 | 16 | public: |
klauss | 17:67a6b557eda5 | 17 | /// Create a Watchdog object |
klauss | 17:67a6b557eda5 | 18 | /// |
klauss | 17:67a6b557eda5 | 19 | /// example: |
klauss | 17:67a6b557eda5 | 20 | /// @code |
klauss | 17:67a6b557eda5 | 21 | /// Watchdog wd; // placed before main |
klauss | 17:67a6b557eda5 | 22 | /// @endcode |
klauss | 17:67a6b557eda5 | 23 | Watchdog(); |
klauss | 17:67a6b557eda5 | 24 | |
klauss | 17:67a6b557eda5 | 25 | /// Configure the timeout for the Watchdog |
klauss | 17:67a6b557eda5 | 26 | /// |
klauss | 17:67a6b557eda5 | 27 | /// This configures the Watchdog service and starts it. It must |
klauss | 17:67a6b557eda5 | 28 | /// be serviced before the timeout, or the system will be restarted. |
klauss | 17:67a6b557eda5 | 29 | /// |
klauss | 17:67a6b557eda5 | 30 | /// example: |
klauss | 17:67a6b557eda5 | 31 | /// @code |
klauss | 17:67a6b557eda5 | 32 | /// ... |
klauss | 17:67a6b557eda5 | 33 | /// wd.Configure(1.4); // configure for a 1.4 second timeout |
klauss | 17:67a6b557eda5 | 34 | /// ... |
klauss | 17:67a6b557eda5 | 35 | /// @endcode |
klauss | 17:67a6b557eda5 | 36 | /// |
klauss | 17:67a6b557eda5 | 37 | /// @param timeout in seconds, as a floating point number |
klauss | 17:67a6b557eda5 | 38 | /// @returns none |
klauss | 17:67a6b557eda5 | 39 | /// |
klauss | 121:ee02790d00b7 | 40 | void Configure ( float timeout ); |
klauss | 17:67a6b557eda5 | 41 | |
klauss | 17:67a6b557eda5 | 42 | /// Service the Watchdog so it does not cause a system reset |
klauss | 17:67a6b557eda5 | 43 | /// |
klauss | 17:67a6b557eda5 | 44 | /// example: |
klauss | 17:67a6b557eda5 | 45 | /// @code |
klauss | 17:67a6b557eda5 | 46 | /// wd.Service(); |
klauss | 17:67a6b557eda5 | 47 | /// @endcode |
klauss | 17:67a6b557eda5 | 48 | /// @returns none |
klauss | 121:ee02790d00b7 | 49 | void kick (); |
klauss | 17:67a6b557eda5 | 50 | |
klauss | 17:67a6b557eda5 | 51 | /// WatchdogCausedReset identifies if the cause of the system |
klauss | 17:67a6b557eda5 | 52 | /// reset was the Watchdog |
klauss | 17:67a6b557eda5 | 53 | /// |
klauss | 17:67a6b557eda5 | 54 | /// example: |
klauss | 17:67a6b557eda5 | 55 | /// @code |
klauss | 69:65665afbad5d | 56 | /// if ( wd.WatchdogCausedReset() ){ |
klauss | 17:67a6b557eda5 | 57 | /// @endcode |
klauss | 17:67a6b557eda5 | 58 | /// |
klauss | 17:67a6b557eda5 | 59 | /// @returns true if the Watchdog was the cause of the reset |
klauss | 121:ee02790d00b7 | 60 | bool WatchdogCausedReset (); |
klauss | 17:67a6b557eda5 | 61 | private: |
klauss | 17:67a6b557eda5 | 62 | bool wdreset; |
klauss | 17:67a6b557eda5 | 63 | }; |
klauss | 17:67a6b557eda5 | 64 | |
klauss | 33:735fd60e96d8 | 65 | #endif |