Skip to content

Commit

Permalink
drivers/hih6130: adapt to new i2c API
Browse files Browse the repository at this point in the history
  • Loading branch information
Joakim Nohlgård authored and dylad committed Jul 25, 2018
1 parent 034d7f0 commit 3994c51
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
4 changes: 2 additions & 2 deletions drivers/hih6130/hih6130.c
Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand Down
6 changes: 0 additions & 6 deletions tests/driver_hih6130/main.c
Expand Up @@ -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);
Expand Down

0 comments on commit 3994c51

Please sign in to comment.