Browse Source

tests/driver_lsm303dlhc: simplified Makefile

cc430
Hauke Petersen 7 years ago
parent
commit
965c69d8be
  1. 54
      tests/driver_lsm303dlhc/Makefile

54
tests/driver_lsm303dlhc/Makefile

@ -3,45 +3,27 @@ include ../Makefile.tests_common
FEATURES_REQUIRED = periph_i2c
# Define default pin mappings for some boards:
ifneq (,$(filter iotlab-m3,$(BOARD)))
export TEST_LSM303DLHC_MAG_ADDR=30
export TEST_LSM303DLHC_ACC_ADDR=25
export TEST_LSM303DLHC_I2C ?=I2C_0
endif
USEMODULE += lsm303dlhc
USEMODULE += xtimer
ifneq (,$(TEST_LSM303DLHC_I2C))
CFLAGS += -DTEST_LSM303DLHC_I2C=$(TEST_LSM303DLHC_I2C)
else
# set random default
CFLAGS += -DTEST_LSM303DLHC_I2C=I2C_0
endif
ifneq (,$(TEST_LSM303DLHC_MAG_ADDR))
CFLAGS += -DTEST_LSM303DLHC_MAG_ADDR=$(TEST_LSM303DLHC_MAG_ADDR)
else
# set random default
CFLAGS += -DTEST_LSM303DLHC_MAG_ADDR=30
endif
ifneq (,$(TEST_LSM303DLHC_ACC_ADDR))
CFLAGS += -DTEST_LSM303DLHC_ACC_ADDR=$(TEST_LSM303DLHC_ACC_ADDR)
else
# set random default
CFLAGS += -DTEST_LSM303DLHC_ACC_ADDR=25
endif
ifneq (,$(TEST_LSM303DLHC_ACC_PIN))
CFLAGS += -DTEST_LSM303DLHC_ACC_PIN=$(TEST_LSM303DLHC_ACC_PIN)
else
# set random default
CFLAGS += -DTEST_LSM303DLHC_ACC_PIN=GPIO_PIN\(0,0\)
endif
ifneq (,$(TEST_LSM303DLHC_MAG_PIN))
CFLAGS += -DTEST_LSM303DLHC_MAG_PIN=$(TEST_LSM303DLHC_MAG_PIN)
else
# set random default
CFLAGS += -DTEST_LSM303DLHC_MAG_PIN=GPIO_PIN\(0,1\)
# define parameters for selected boards
ifneq (,$(filter iotlab-m3,$(BOARD)))
TEST_LSM303DLHC_ACC_PIN ?= GPIO_PIN\(PORT_B,1\)
TEST_LSM303DLHC_MAG_PIN ?= GPIO_PIN\(PORT_B,2\)
endif
# set default device parameters in case they are undefined
TEST_LSM303DLHC_I2C ?= I2C_0
TEST_LSM303DLHC_ACC_ADDR ?= 25
TEST_LSM303DLHC_MAG_ADDR ?= 30
TEST_LSM303DLHC_ACC_PIN ?= GPIO_PIN\(0,0\)
TEST_LSM303DLHC_MAG_PIN ?= GPIO_PIN\(0,1\)
# export parameters
CFLAGS += -DTEST_LSM303DLHC_I2C=$(TEST_LSM303DLHC_I2C)
CFLAGS += -DTEST_LSM303DLHC_ACC_ADDR=$(TEST_LSM303DLHC_ACC_ADDR)
CFLAGS += -DTEST_LSM303DLHC_MAG_ADDR=$(TEST_LSM303DLHC_MAG_ADDR)
CFLAGS += -DTEST_LSM303DLHC_ACC_PIN=$(TEST_LSM303DLHC_ACC_PIN)
CFLAGS += -DTEST_LSM303DLHC_MAG_PIN=$(TEST_LSM303DLHC_MAG_PIN)
include $(RIOTBASE)/Makefile.include

Loading…
Cancel
Save