Skip to content
Snippets Groups Projects
Commit 39533eb2 authored by Kaspar Schleiser's avatar Kaspar Schleiser
Browse files

drivers: hih6130: switch to xtimer

parent ada06e9d
No related branches found
No related tags found
No related merge requests found
......@@ -330,7 +330,7 @@ ifneq (,$(filter gnrc_netdev2,$(USEMODULE)))
endif
ifneq (,$(filter hih6130,$(USEMODULE)))
USEMODULE += vtimer
USEMODULE += xtimer
endif
ifneq (,$(filter encx24j600,$(USEMODULE)))
......
......@@ -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);
......
......@@ -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)
......
......@@ -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) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment