diff --git a/Makefile.dep b/Makefile.dep index 3193352c2bde7b72e6af588d76cc0673b61e5e7b..c04601c8861245611502f0dd0bd168f6aec75e3b 100644 --- a/Makefile.dep +++ b/Makefile.dep @@ -330,7 +330,7 @@ ifneq (,$(filter gnrc_netdev2,$(USEMODULE))) endif ifneq (,$(filter hih6130,$(USEMODULE))) - USEMODULE += vtimer + USEMODULE += xtimer endif ifneq (,$(filter encx24j600,$(USEMODULE))) diff --git a/drivers/hih6130/hih6130.c b/drivers/hih6130/hih6130.c index 8050e7430588b821d669c207fbd136d1912a8b20..c23b81f7acb9e70f615631d933d92a3ef6f3ca09 100644 --- a/drivers/hih6130/hih6130.c +++ b/drivers/hih6130/hih6130.c @@ -24,8 +24,7 @@ #include "hih6130.h" #include "periph/i2c.h" -#include "timex.h" -#include "vtimer.h" +#include "xtimer.h" #define ENABLE_DEBUG (0) #include "debug.h" @@ -53,8 +52,7 @@ enum { }; /** @brief Delay between requesting a measurement and data becoming ready */ -static const timex_t measurement_delay = { - .seconds = 0, .microseconds = 50 * MS_IN_USEC, }; +#define MEASUREMENT_DELAY (50*1000) /** @brief Trigger a new measurement on the sensor */ static inline int hih6130_measurement_request(hih6130_t *dev) @@ -121,7 +119,7 @@ int hih6130_get_humidity_temperature_float(hih6130_t *dev, return -1; } - vtimer_sleep(measurement_delay); + xtimer_usleep(MEASUREMENT_DELAY); status = hih6130_get_humidity_temperature_raw(dev, &hum_raw, &temp_raw); diff --git a/tests/driver_hih6130/Makefile b/tests/driver_hih6130/Makefile index eecfc85e9ca8d5b10d17ce4a4774b7ad0b7471f6..032e0da40f1b27b7e811c0e5a235f11674a7cc21 100644 --- a/tests/driver_hih6130/Makefile +++ b/tests/driver_hih6130/Makefile @@ -4,7 +4,7 @@ include ../Makefile.tests_common FEATURES_REQUIRED = periph_i2c USEMODULE += hih6130 -USEMODULE += vtimer +USEMODULE += xtimer ifneq (,$(TEST_HIH6130_I2C)) CFLAGS += -DTEST_HIH6130_I2C=$(TEST_HIH6130_I2C) diff --git a/tests/driver_hih6130/main.c b/tests/driver_hih6130/main.c index 7585ab21b1ea2eab0cfe4a8c481eb570bc4d687b..a7b7821c496d11dce8dfdb3eeb4b50b8e3c120f7 100644 --- a/tests/driver_hih6130/main.c +++ b/tests/driver_hih6130/main.c @@ -29,7 +29,7 @@ #include <stdlib.h> #include <math.h> -#include "vtimer.h" +#include "xtimer.h" #include "hih6130.h" #define SLEEP (100 * 1000U) @@ -58,7 +58,7 @@ int main(void) float integral = 0.f; float fractional; - vtimer_usleep(SLEEP); + xtimer_usleep(SLEEP); status = hih6130_get_humidity_temperature_float(&dev, &hum, &temp); if (status < 0) {