Skip to content

Instantly share code, notes, and snippets.

@SatokiOgiso
Created October 22, 2016 18:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SatokiOgiso/1a8639734daef5235fe12eff8c587d6e to your computer and use it in GitHub Desktop.
Save SatokiOgiso/1a8639734daef5235fe12eff8c587d6e to your computer and use it in GitHub Desktop.
#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