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

tests/driver_nvram_spi: simplified Makefile

This commit is contained in:
Hauke Petersen 2015-11-03 15:27:25 +01:00
parent ddd4117e12
commit f9ce415d3f

View File

@ -6,29 +6,16 @@ FEATURES_REQUIRED = periph_spi periph_gpio
USEMODULE += nvram_spi
USEMODULE += xtimer
ifneq (,$(TEST_NVRAM_SPI_DEV))
CFLAGS += -DTEST_NVRAM_SPI_DEV=$(TEST_NVRAM_SPI_DEV)
else
# set arbitrary default
CFLAGS += -DTEST_NVRAM_SPI_DEV=SPI_0
endif
ifneq (,$(TEST_NVRAM_SPI_CS))
CFLAGS += -DTEST_NVRAM_SPI_CS=$(TEST_NVRAM_SPI_CS)
else
# set arbitrary default
CFLAGS += -DTEST_NVRAM_SPI_CS=GPIO_PIN\(0,0\)
endif
ifneq (,$(TEST_NVRAM_SPI_SIZE))
CFLAGS += -DTEST_NVRAM_SPI_SIZE=$(TEST_NVRAM_SPI_SIZE)
else
# set tiny arbitrary default
CFLAGS += -DTEST_NVRAM_SPI_SIZE=64
endif
ifneq (,$(TEST_NVRAM_SPI_ADDRESS_COUNT))
CFLAGS += -DTEST_NVRAM_SPI_ADDRESS_COUNT=$(TEST_NVRAM_SPI_ADDRESS_COUNT)
else
# set 1 address byte by default, increase if using a larger module for test.
CFLAGS += -DTEST_NVRAM_SPI_ADDRESS_COUNT=1
endif
# set default device parameters in case they are undefined
TEST_NVRAM_SPI_DEV ?= SPI_0
TEST_NVRAM_SPI_CS ?= GPIO_PIN\(0,0\)
TEST_NVRAM_SPI_SIZE ?= 64
TEST_NVRAM_SPI_ADDRESS_COUNT ?= 1
# export parameters
CFLAGS += -DTEST_NVRAM_SPI_DEV=$(TEST_NVRAM_SPI_DEV)
CFLAGS += -DTEST_NVRAM_SPI_CS=$(TEST_NVRAM_SPI_CS)
CFLAGS += -DTEST_NVRAM_SPI_SIZE=$(TEST_NVRAM_SPI_SIZE)
CFLAGS += -DTEST_NVRAM_SPI_ADDRESS_COUNT=$(TEST_NVRAM_SPI_ADDRESS_COUNT)
include $(RIOTBASE)/Makefile.include