LPC1768 and LPC11U24 watchdog timer
Dependents: GSwifi_tsutenkaku barometer-m0 BMAGThrRev
Diff: WDT.h
- Revision:
- 2:f6f05e2eafd0
- Parent:
- 0:f28de891b0d3
- Child:
- 3:b1efde09d8a7
--- a/WDT.h Sat Aug 04 11:36:51 2012 +0000 +++ b/WDT.h Fri Jul 11 00:53:14 2014 +0000 @@ -1,5 +1,10 @@ -// Simon's Watchdog code from -// http://mbed.org/forum/mbed/topic/508/ +#ifndef _WDT_H_ +#define _WDT_H_ + +#include "mbed.h" + +// Simon's Watchdog +// see: http://mbed.org/forum/mbed/topic/508/ class Watchdog { public: // Load timeout value in watchdog timer and enable @@ -9,4 +14,18 @@ void kick(); int getFlg (); + + void attach (void (*fptr)(void), float s); + + template<typename T> + void attach (T *object, void (*fptr)(void), float s); + + void sleep (); + void deepSleep (); + +private: + static FunctionPointer _fptr; + static void isr_wdt(void); }; + +#endif