diff --git a/tests/driver_tsl2561/Makefile b/tests/driver_tsl2561/Makefile index a6a70248cd..d1a27e3699 100644 --- a/tests/driver_tsl2561/Makefile +++ b/tests/driver_tsl2561/Makefile @@ -1,20 +1,6 @@ include ../Makefile.tests_common -FEATURES_REQUIRED = periph_i2c - USEMODULE += tsl2561 USEMODULE += xtimer -# set default device parameters in case they are undefined -TEST_I2C ?= I2C_DEV\(0\) -TEST_ADDR ?= TSL2561_ADDR_FLOAT -TEST_GAIN ?= TSL2561_GAIN_1X -TEST_INTEGRATION_TIME ?= TSL2561_INTEGRATIONTIME_402MS - -# export parameters -CFLAGS += -DTEST_I2C=$(TEST_I2C) -CFLAGS += -DTEST_ADDR=$(TEST_ADDR) -CFLAGS += -DTEST_GAIN=$(TEST_GAIN) -CFLAGS += -DTEST_INTEGRATION_TIME=$(TEST_INTEGRATION_TIME) - include $(RIOTBASE)/Makefile.include diff --git a/tests/driver_tsl2561/main.c b/tests/driver_tsl2561/main.c index d7c04d09d4..1cf4209b5f 100644 --- a/tests/driver_tsl2561/main.c +++ b/tests/driver_tsl2561/main.c @@ -18,29 +18,15 @@ * @} */ -#ifndef TEST_I2C -#error "TEST_I2C not defined" -#endif - -#ifndef TEST_ADDR -#error "TEST_ADDR not defined" -#endif - -#ifndef TEST_GAIN -#error "TEST_GAIN not defined" -#endif - -#ifndef TEST_INTEGRATION_TIME -#error "TEST_INTEGRATION_TIME not defined" -#endif - #include #include -#include "tsl2561.h" #include "xtimer.h" #include "board.h" +#include "tsl2561.h" +#include "tsl2561_params.h" + #define SLEEP_1S (1 * 1000 * 1000u) /* 1 second delay between printf */ int main(void) @@ -51,8 +37,7 @@ int main(void) printf("+------------Initializing------------+\n"); - switch(tsl2561_init(&dev, TEST_I2C, TEST_ADDR, - TEST_GAIN, TEST_INTEGRATION_TIME)) { + switch(tsl2561_init(&dev, &tsl2561_params[0])) { case TSL2561_NOI2C: puts("[Error] I2C not working: cannot initialize the sensor.\n"); break;