Skip to content
Snippets Groups Projects
Commit 0b616acb authored by Hauke Petersen's avatar Hauke Petersen
Browse files

tests/periph_gpio: make IRQ commands optional

only include irq related shell commands in case the
PERIPH_GPIO_IRQ feature is selected
parent c7e6d159
No related branches found
No related tags found
No related merge requests found
......@@ -3,7 +3,7 @@ include ../Makefile.tests_common
BOARD_INSUFFICIENT_MEMORY := arduino-duemilanove arduino-uno
FEATURES_REQUIRED = periph_gpio
FEATURES_REQUIRED = periph_gpio_irq
FEATURES_OPTIONAL = periph_gpio_irq
USEMODULE += shell
USEMODULE += benchmark
......
......@@ -28,10 +28,12 @@
#define BENCH_RUNS_DEFAULT (1000UL * 1000)
#ifdef MODULE_PERIPH_GPIO_IRQ
static void cb(void *arg)
{
printf("INT: external interrupt from pin %i\n", (int)arg);
}
#endif
static int init_pin(int argc, char **argv, gpio_mode_t mode)
{
......@@ -83,6 +85,7 @@ static int init_od_pu(int argc, char **argv)
return init_pin(argc, argv, GPIO_OD_PU);
}
#ifdef MODULE_PERIPH_GPIO_IRQ
static int init_int(int argc, char **argv)
{
int po, pi;
......@@ -148,6 +151,7 @@ static int init_int(int argc, char **argv)
return 0;
}
#endif
static int read(int argc, char **argv)
{
......@@ -238,7 +242,9 @@ static const shell_command_t shell_commands[] = {
{ "init_in_pd", "init as input with pull-down", init_in_pd },
{ "init_od", "init as output (open-drain without pull resistor)", init_od },
{ "init_od_pu", "init as output (open-drain with pull-up)", init_od_pu },
#ifdef MODULE_PERIPH_GPIO_IRQ
{ "init_int", "init as external INT w/o pull resistor", init_int },
#endif
{ "read", "read pin status", read },
{ "set", "set pin to HIGH", set },
{ "clear", "set pin to LOW", clear },
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment