1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-24 22:13:52 +01:00

tests/periph_pm: allow interrupt flank definition

This commit is contained in:
Gunar Schorcht 2020-03-19 08:17:41 +01:00
parent d281d4843f
commit c0c478a145

View File

@ -35,6 +35,10 @@
#endif
#include "shell.h"
#ifndef BTN0_INT_FLANK
#define BTN0_INT_FLANK GPIO_RISING
#endif
#ifdef MODULE_PM_LAYERED
static int check_mode(int argc, char **argv)
{
@ -216,7 +220,6 @@ static void btn_cb(void *ctx)
}
#endif /* MODULE_PERIPH_GPIO_IRQ */
/**
* @brief List of shell commands for this example.
*/
@ -256,7 +259,7 @@ int main(void)
#if defined(MODULE_PERIPH_GPIO_IRQ) && defined(BTN0_PIN)
puts("using BTN0 as wake-up source");
gpio_init_int(BTN0_PIN, BTN0_MODE, GPIO_RISING, btn_cb, NULL);
gpio_init_int(BTN0_PIN, BTN0_MODE, BTN0_INT_FLANK, btn_cb, NULL);
#endif
/* run the shell and wait for the user to enter a mode */