![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Modularizando o src
Dependencies: EALib EthernetInterface_vz mbed-rtos mbed
Fork of header_main_colinas_V0-20-09-14 by
wdt.h@69:65665afbad5d, 2014-11-12 (annotated)
- Committer:
- klauss
- Date:
- Wed Nov 12 13:25:54 2014 +0000
- Revision:
- 69:65665afbad5d
- Parent:
- 33:735fd60e96d8
- Child:
- 121:ee02790d00b7
versao em re-valida??o a priori, os dados de audio est?o se perdendo
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 | 17:67a6b557eda5 | 8 | #ifndef _WDT_H |
klauss | 17:67a6b557eda5 | 9 | #define _WDT_H |
klauss | 17:67a6b557eda5 | 10 | #include "mbed.h" |
klauss | 17:67a6b557eda5 | 11 | |
klauss | 17:67a6b557eda5 | 12 | class Watchdog { |
klauss | 17:67a6b557eda5 | 13 | public: |
klauss | 17:67a6b557eda5 | 14 | /// Create a Watchdog object |
klauss | 17:67a6b557eda5 | 15 | /// |
klauss | 17:67a6b557eda5 | 16 | /// example: |
klauss | 17:67a6b557eda5 | 17 | /// @code |
klauss | 17:67a6b557eda5 | 18 | /// Watchdog wd; // placed before main |
klauss | 17:67a6b557eda5 | 19 | /// @endcode |
klauss | 17:67a6b557eda5 | 20 | Watchdog(); |
klauss | 17:67a6b557eda5 | 21 | |
klauss | 17:67a6b557eda5 | 22 | /// Configure the timeout for the Watchdog |
klauss | 17:67a6b557eda5 | 23 | /// |
klauss | 17:67a6b557eda5 | 24 | /// This configures the Watchdog service and starts it. It must |
klauss | 17:67a6b557eda5 | 25 | /// be serviced before the timeout, or the system will be restarted. |
klauss | 17:67a6b557eda5 | 26 | /// |
klauss | 17:67a6b557eda5 | 27 | /// example: |
klauss | 17:67a6b557eda5 | 28 | /// @code |
klauss | 17:67a6b557eda5 | 29 | /// ... |
klauss | 17:67a6b557eda5 | 30 | /// wd.Configure(1.4); // configure for a 1.4 second timeout |
klauss | 17:67a6b557eda5 | 31 | /// ... |
klauss | 17:67a6b557eda5 | 32 | /// @endcode |
klauss | 17:67a6b557eda5 | 33 | /// |
klauss | 17:67a6b557eda5 | 34 | /// @param timeout in seconds, as a floating point number |
klauss | 17:67a6b557eda5 | 35 | /// @returns none |
klauss | 17:67a6b557eda5 | 36 | /// |
klauss | 17:67a6b557eda5 | 37 | void Configure(float timeout); |
klauss | 17:67a6b557eda5 | 38 | |
klauss | 17:67a6b557eda5 | 39 | /// Service the Watchdog so it does not cause a system reset |
klauss | 17:67a6b557eda5 | 40 | /// |
klauss | 17:67a6b557eda5 | 41 | /// example: |
klauss | 17:67a6b557eda5 | 42 | /// @code |
klauss | 17:67a6b557eda5 | 43 | /// wd.Service(); |
klauss | 17:67a6b557eda5 | 44 | /// @endcode |
klauss | 17:67a6b557eda5 | 45 | /// @returns none |
klauss | 17:67a6b557eda5 | 46 | void kick(); |
klauss | 17:67a6b557eda5 | 47 | |
klauss | 17:67a6b557eda5 | 48 | /// WatchdogCausedReset identifies if the cause of the system |
klauss | 17:67a6b557eda5 | 49 | /// reset was the Watchdog |
klauss | 17:67a6b557eda5 | 50 | /// |
klauss | 17:67a6b557eda5 | 51 | /// example: |
klauss | 17:67a6b557eda5 | 52 | /// @code |
klauss | 69:65665afbad5d | 53 | /// if ( wd.WatchdogCausedReset() ){ |
klauss | 17:67a6b557eda5 | 54 | /// @endcode |
klauss | 17:67a6b557eda5 | 55 | /// |
klauss | 17:67a6b557eda5 | 56 | /// @returns true if the Watchdog was the cause of the reset |
klauss | 17:67a6b557eda5 | 57 | bool WatchdogCausedReset(); |
klauss | 17:67a6b557eda5 | 58 | private: |
klauss | 17:67a6b557eda5 | 59 | bool wdreset; |
klauss | 17:67a6b557eda5 | 60 | }; |
klauss | 17:67a6b557eda5 | 61 | |
klauss | 33:735fd60e96d8 | 62 | #endif |