From 13c18011c7c097cb69ab3475a9514c33c8326f8d Mon Sep 17 00:00:00 2001 From: George Oikonomou Date: Sun, 11 Mar 2018 20:06:36 +0000 Subject: [PATCH] Change the GPIO HAL example to use the new button API --- examples/dev/gpio-hal/gpio-hal-example.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/examples/dev/gpio-hal/gpio-hal-example.c b/examples/dev/gpio-hal/gpio-hal-example.c index 83f3b6a2f..040df3b38 100644 --- a/examples/dev/gpio-hal/gpio-hal-example.c +++ b/examples/dev/gpio-hal/gpio-hal-example.c @@ -33,7 +33,7 @@ #include "dev/gpio-hal.h" #include "sys/etimer.h" #include "lib/sensors.h" -#include "dev/button-sensor.h" +#include "dev/button-hal.h" #include /*---------------------------------------------------------------------------*/ @@ -129,8 +129,9 @@ PROCESS_THREAD(gpio_hal_example, ev, data) counter++; etimer_set(&et, CLOCK_SECOND); - } else if(ev == sensors_event && data == &button_sensor) { - printf("Button event\n"); + } else if(ev == button_hal_release_event) { + printf("Button release event %s\n", + BUTTON_HAL_GET_DESCRIPTION((button_hal_button_t *)data)); } }