Class similar to InterruptIn which allows the LPC1114 to wake from deepsleep. (For other targets you can use InterruptIn).
Dependents: WakeUp WakeUp WakeUp WakeUp ... more
Revision 1:128f3fe79240, committed 2014-07-28
- Comitter:
- Sissors
- Date:
- Mon Jul 28 06:14:48 2014 +0000
- Parent:
- 0:d726461bd0af
- Commit message:
- Added include guards + only include it on correct targets (allows for re-using it in other libraries)
Changed in this revision
WakeInterruptIn.cpp | Show annotated file Show diff for this revision Revisions of this file |
WakeInterruptIn.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/WakeInterruptIn.cpp Sat Jul 26 15:02:43 2014 +0000 +++ b/WakeInterruptIn.cpp Mon Jul 28 06:14:48 2014 +0000 @@ -1,3 +1,5 @@ +#ifdef TARGET_LPC11XX_11CXX + #include "WakeInterruptIn.h" WakeInterruptIn* WakeInterruptIn::objects[NUM_CHANNEL] = {0}; @@ -54,3 +56,5 @@ break; } } + +#endif \ No newline at end of file
--- a/WakeInterruptIn.h Sat Jul 26 15:02:43 2014 +0000 +++ b/WakeInterruptIn.h Mon Jul 28 06:14:48 2014 +0000 @@ -4,6 +4,12 @@ simple library helps with that */ +//Only include it for correct target. This allows me to re-use it in WakeUp lib +#ifdef TARGET_LPC11XX_11CXX + +#ifndef WAKEINTERRUPTIN_H +#define WAKEINTERRUPTIN_H + #include "mbed.h" #define NUM_CHANNEL 13 @@ -84,6 +90,7 @@ FunctionPointer fpointer; void enable(void) { + LPC_SYSCON->STARTRSRP0CLR = 1 << channel; LPC_SYSCON->STARTERP0 |= (1 << channel); NVIC_EnableIRQ((IRQn_Type)channel); } @@ -113,4 +120,6 @@ static void handler11(void) { objects[11]->handle(); } static void handler12(void) { objects[12]->handle(); } -}; \ No newline at end of file +}; +#endif +#endif \ No newline at end of file