XtrmDesignsLLC GRPeach
/
mbed_sleep_blinky
WFI sleep and wake-up for GR-PEACH
Revision 1:e508448feb1c, committed 2016-11-17
- Comitter:
- pateshian
- Date:
- Thu Nov 17 16:33:21 2016 +0000
- Parent:
- 0:ab9939da6645
- Commit message:
- WFI based sleep and wake-up for GR-PEACH on mbed5.X
Changed in this revision
mbed_sleep_blinky.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r ab9939da6645 -r e508448feb1c mbed_sleep_blinky.cpp --- a/mbed_sleep_blinky.cpp Thu Nov 17 15:52:54 2016 +0000 +++ b/mbed_sleep_blinky.cpp Thu Nov 17 16:33:21 2016 +0000 @@ -1,22 +1,17 @@ #include "mbed.h" #define IRQ4 (36) gpio_irq_t irqHandler; - DigitalOut led1(LED1); int gFlag = 0; - void interrupt_irq4_user (uint32_t id, gpio_irq_event event) { if (!gFlag){ gFlag = 1; } } - // main() runs in its own thread in the OS // (note the calls to Thread::wait below for delays) int main() { - - gpio_irq_init (&irqHandler, USER_BUTTON0, interrupt_irq4_user, IRQ4); - + gpio_irq_init (&irqHandler, USER_BUTTON0, interrupt_irq4_user, IRQ4); while (true) { if ( gFlag == 1 ) { gFlag = 0;