Skip to content

Commit

Permalink
[rem later] lpm app adaption
Browse files Browse the repository at this point in the history
  • Loading branch information
fnack committed Feb 7, 2015
1 parent 4136366 commit 1a777c5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions examples/lpm/Makefile
Expand Up @@ -30,4 +30,6 @@ CFLAGS += -DDEVELHELP
# Change this to 0 show compiler invocation lines by default:
QUIET ?= 1

USEMODULE += vtimer

include $(RIOTBASE)/Makefile.include
6 changes: 6 additions & 0 deletions examples/lpm/main.c
Expand Up @@ -27,6 +27,7 @@
#include "cpu-conf.h"
#include "periph/gpio.h"
#include "arch/lpm_arch.h"
#include "vtimer.h"

static void button_handler(void *args)
{
Expand All @@ -37,6 +38,8 @@ int main(void)
{
puts("LPM example application");

vtimer_init();

gpio_init_int(WKUP_GPIO, GPIO_NOPULL, GPIO_RISING, &button_handler, 0);

/* Check whether the device was reset from standby */
Expand All @@ -49,14 +52,17 @@ int main(void)
lpm_arch_init();

puts("Entering LPM_IDLE");
vtimer_usleep(100000);
lpm_arch_set(LPM_IDLE);
puts("Successfully awoke from LPM_IDLE");

puts("Entering LPM_SLEEP");
vtimer_usleep(100000);
lpm_arch_set(LPM_SLEEP);
puts("Successfully awoke from LPM_SLEEP");

puts("Entering LPM_POWERDOWN");
vtimer_usleep(100000);
lpm_arch_set(LPM_POWERDOWN);

/* Never reached */
Expand Down

0 comments on commit 1a777c5

Please sign in to comment.