From 3994c51b31d4dd805c15397ab5d24b10ef1ae2af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Nohlg=C3=A5rd?= Date: Sat, 2 Jun 2018 00:44:23 +0200 Subject: [PATCH] drivers/hih6130: adapt to new i2c API --- drivers/hih6130/hih6130.c | 4 ++-- tests/driver_hih6130/main.c | 6 ------ 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/hih6130/hih6130.c b/drivers/hih6130/hih6130.c index 2175e65008..a34f64156a 100644 --- a/drivers/hih6130/hih6130.c +++ b/drivers/hih6130/hih6130.c @@ -60,7 +60,7 @@ static inline int hih6130_measurement_request(const hih6130_t *dev) i2c_acquire(dev->i2c); /* An empty write request triggers a new measurement */ - if (i2c_write_bytes(dev->i2c, dev->addr, NULL, 0) < 0) { + if (i2c_write_bytes(dev->i2c, dev->addr, NULL, 0, 0) < 0) { i2c_release(dev->i2c); return -1; } @@ -84,7 +84,7 @@ static inline int hih6130_get_humidity_temperature_raw(const hih6130_t *dev, uin i2c_acquire(dev->i2c); - if (i2c_read_bytes(dev->i2c, dev->addr, &buf[0], sizeof(buf)) != sizeof(buf)) { + if (i2c_read_bytes(dev->i2c, dev->addr, &buf[0], sizeof(buf), 0) < 0) { i2c_release(dev->i2c); return -1; } diff --git a/tests/driver_hih6130/main.c b/tests/driver_hih6130/main.c index 3a30bcf6fb..650f6cbae7 100644 --- a/tests/driver_hih6130/main.c +++ b/tests/driver_hih6130/main.c @@ -39,12 +39,6 @@ int main(void) hih6130_t dev; puts("HIH6130 sensor driver test application\n"); - printf("Initializing I2C_%i... ", TEST_HIH6130_I2C); - if (i2c_init_master(TEST_HIH6130_I2C, I2C_SPEED_FAST) < 0) { - puts("[Failed]"); - return -1; - } - puts("[OK]"); printf("Initializing HIH6130 sensor at I2C_%i, address 0x%02x... ", TEST_HIH6130_I2C, TEST_HIH6130_ADDR);