tests/driver_pir: remove redundant/double configuration from Makefile

This commit is contained in:
Hyungsin 2018-07-03 11:06:57 -07:00
parent 4fcd58acfd
commit 492c86b9d7
2 changed files with 6 additions and 33 deletions

View File

@ -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

View File

@ -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:
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: