From 3d2b11b251926474f54e5a54f1396b2545e546a5 Mon Sep 17 00:00:00 2001 From: Alexandre Abadie <alexandre.abadie@inria.fr> Date: Thu, 23 Mar 2017 14:19:52 +0100 Subject: [PATCH] tests/driver_io1_xplained: adapt application to API change --- tests/driver_io1_xplained/Makefile | 6 ------ tests/driver_io1_xplained/main.c | 17 +++++------------ 2 files changed, 5 insertions(+), 18 deletions(-) diff --git a/tests/driver_io1_xplained/Makefile b/tests/driver_io1_xplained/Makefile index 5794cb2e96..4302992555 100644 --- a/tests/driver_io1_xplained/Makefile +++ b/tests/driver_io1_xplained/Makefile @@ -5,10 +5,4 @@ USEMODULE += io1_xplained USEMODULE += xtimer USEMODULE += printf_float -# set default device parameters in case they are undefined -TEST_ADDR ?= 0x07 - -# export parameters -CFLAGS += -DTEST_ADDR=$(TEST_ADDR) - include $(RIOTBASE)/Makefile.include diff --git a/tests/driver_io1_xplained/main.c b/tests/driver_io1_xplained/main.c index 39ca98edcc..60e0f90824 100644 --- a/tests/driver_io1_xplained/main.c +++ b/tests/driver_io1_xplained/main.c @@ -18,14 +18,11 @@ * @} */ -#ifndef TEST_ADDR -#error "TEST_ADDR not defined" -#endif - #include <stdio.h> #include <inttypes.h> #include "io1_xplained.h" +#include "io1_xplained_params.h" #include "xtimer.h" #include "board.h" @@ -35,21 +32,17 @@ int main(void) { io1_xplained_t dev; float temperature; - int result; puts("IO1 Xplained extention test application\n"); + puts("+-------------Initializing------------+\n"); - printf("+------------Initializing------------+\n"); - result = io1_xplained_init(&dev, TEST_ADDR); - if (result == -1) { + if (io1_xplained_init(&dev, &io1_xplained_params[0]) != IO1_XPLAINED_OK) { puts("[Error] Cannot initialize the IO1 Xplained extension\n"); return 1; } - else { - printf("Initialization successful\n\n"); - } - printf("\n+--------Starting tests --------+\n"); + puts("Initialization successful"); + puts("\n+--------Starting tests --------+"); while (1) { /* Get temperature in degrees celsius */ io1_xplained_read_temperature(&dev, &temperature); -- GitLab