1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-17 05:32:45 +01:00

drivers: hih6130: switch to xtimer

This commit is contained in:
Kaspar Schleiser 2015-08-14 00:53:19 +02:00
parent ada06e9d22
commit 39533eb28c
4 changed files with 7 additions and 9 deletions

View File

@ -330,7 +330,7 @@ ifneq (,$(filter gnrc_netdev2,$(USEMODULE)))
endif
ifneq (,$(filter hih6130,$(USEMODULE)))
USEMODULE += vtimer
USEMODULE += xtimer
endif
ifneq (,$(filter encx24j600,$(USEMODULE)))

View File

@ -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);

View File

@ -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)

View File

@ -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) {