Created
October 22, 2016 18:23
-
-
Save SatokiOgiso/1a8639734daef5235fe12eff8c587d6e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "mbed.h" | |
InterruptIn button(dp2); | |
static void wake() { | |
//wake routine, do something before next sleep | |
} | |
int main() { | |
button.fall(wake); // attach the address of the flip function to the rising edge | |
LPC_SYSCON->STARTERP0 |= 0x0200; // PIO0_9 (dp2) as wakeup input | |
while(1) | |
{ | |
deepsleep(); | |
//code here below never execute | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment