Skip to content
Snippets Groups Projects
Commit 3d2b11b2 authored by Alexandre Abadie's avatar Alexandre Abadie
Browse files

tests/driver_io1_xplained: adapt application to API change

parent 57c26631
No related branches found
No related tags found
No related merge requests found
...@@ -5,10 +5,4 @@ USEMODULE += io1_xplained ...@@ -5,10 +5,4 @@ USEMODULE += io1_xplained
USEMODULE += xtimer USEMODULE += xtimer
USEMODULE += printf_float 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 include $(RIOTBASE)/Makefile.include
...@@ -18,14 +18,11 @@ ...@@ -18,14 +18,11 @@
* @} * @}
*/ */
#ifndef TEST_ADDR
#error "TEST_ADDR not defined"
#endif
#include <stdio.h> #include <stdio.h>
#include <inttypes.h> #include <inttypes.h>
#include "io1_xplained.h" #include "io1_xplained.h"
#include "io1_xplained_params.h"
#include "xtimer.h" #include "xtimer.h"
#include "board.h" #include "board.h"
...@@ -35,21 +32,17 @@ int main(void) ...@@ -35,21 +32,17 @@ int main(void)
{ {
io1_xplained_t dev; io1_xplained_t dev;
float temperature; float temperature;
int result;
puts("IO1 Xplained extention test application\n"); puts("IO1 Xplained extention test application\n");
puts("+-------------Initializing------------+\n");
printf("+------------Initializing------------+\n"); if (io1_xplained_init(&dev, &io1_xplained_params[0]) != IO1_XPLAINED_OK) {
result = io1_xplained_init(&dev, TEST_ADDR);
if (result == -1) {
puts("[Error] Cannot initialize the IO1 Xplained extension\n"); puts("[Error] Cannot initialize the IO1 Xplained extension\n");
return 1; return 1;
} }
else {
printf("Initialization successful\n\n");
}
printf("\n+--------Starting tests --------+\n"); puts("Initialization successful");
puts("\n+--------Starting tests --------+");
while (1) { while (1) {
/* Get temperature in degrees celsius */ /* Get temperature in degrees celsius */
io1_xplained_read_temperature(&dev, &temperature); io1_xplained_read_temperature(&dev, &temperature);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment