Skip to content
Snippets Groups Projects
Unverified Commit 2c37309b authored by Alexandre Abadie's avatar Alexandre Abadie Committed by GitHub
Browse files

Merge pull request #9488 from Hyungsin/forupstream_pir

tests/driver_pir: remove redundant/double configuration from Makefile
parents 4fcd58ac 492c86b9
No related branches found
No related tags found
No related merge requests found
...@@ -2,28 +2,7 @@ include ../Makefile.tests_common ...@@ -2,28 +2,7 @@ include ../Makefile.tests_common
BOARD_INSUFFICIENT_MEMORY := nucleo-f031k6 BOARD_INSUFFICIENT_MEMORY := nucleo-f031k6
FEATURES_REQUIRED = periph_gpio
USEMODULE += pir USEMODULE += pir
USEMODULE += xtimer
# define parameters for selected boards
ifneq (,$(filter stm32f4discovery,$(BOARD)))
PIR_PARAM_GPIO ?= GPIO_PIN\(3,7\)
PIR_PARAM_ACTIVE_HIGH ?= 1
endif
ifneq (,$(filter arduino-due,$(BOARD)))
PIR_PARAM_GPIO ?= GPIO_PIN\(0,20\)
PIR_PARAM_ACTIVE_HIGH ?= 1
endif
# set default device parameters in case they are undefined
PIR_PARAM_GPIO ?= GPIO_PIN\(0,0\)
PIR_PARAM_ACTIVE_HIGH ?= 1
# export parameters
CFLAGS += -DPIR_PARAM_GPIO=$(PIR_PARAM_GPIO)
CFLAGS += -DPIR_PARAM_ACTIVE_HIGH=$(PIR_PARAM_ACTIVE_HIGH)
include $(RIOTBASE)/Makefile.include include $(RIOTBASE)/Makefile.include
......
...@@ -15,12 +15,9 @@ Connect the sensor's "out" pin to a GPIO of your board that can be ...@@ -15,12 +15,9 @@ Connect the sensor's "out" pin to a GPIO of your board that can be
configured to create interrupts. configured to create interrupts.
Compile and flash this test application like: Compile and flash this test application like:
export BOARD=your_board CFLAGS="-DPIR_PARAM_GPIO=name_of_your_pin -DPIR_PARAM_ACTIVE_HIGH=if_gpio_pin_is_high_or_low_when_pir_is_active" make BOARD=your_board clean all-interrupt flash
export PIR_PARAM_GPIO=name_of_your_pin
export PIR_PARAM_ACTIVE_HIGH=if_gpio_pin_is_high_or_low_when_pir_is_active Ideally, the above configuration passed via CFLAGS should be in "board.h"
make clean
make all-interrupt
make flash
The output should look like: The output should look like:
...@@ -40,12 +37,9 @@ The output should look like: ...@@ -40,12 +37,9 @@ The output should look like:
Connect the sensor's "out" pin to any GPIO pin of you board. Connect the sensor's "out" pin to any GPIO pin of you board.
Compile and flash this test application like: Compile and flash this test application like:
export BOARD=your_board CFLAGS="-DPIR_PARAM_GPIO=name_of_your_pin -DPIR_PARAM_ACTIVE_HIGH=if_gpio_pin_is_high_or_low_when_pir_is_active" make BOARD=your_board make clean all-polling flash
export PIR_PARAM_GPIO=name_of_your_pin
export PIR_PARAM_ACTIVE_HIGH=if_gpio_pin_is_high_or_low_when_pir_is_active Ideally, the above configuration passed via CFLAGS should be in "board.h"
make clean
make all-polling
make flash
The output should look like this: The output should look like this:
......
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