1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

drivers/hih6130: adapt to new i2c API

This commit is contained in:
Joakim Nohlgård 2018-06-02 00:44:23 +02:00 committed by dylad
parent 034d7f0b8f
commit 3994c51b31
2 changed files with 2 additions and 8 deletions

View File

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

View File

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