mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-18 12:52:44 +01:00
drivers/srf02: fixed missing i2c_release in init()
This commit is contained in:
parent
ff2ff5d008
commit
c86a06d585
@ -73,6 +73,7 @@ int srf02_init(srf02_t *dev, i2c_t i2c, uint8_t addr)
|
|||||||
/* try to read the software revision (read the CMD reg) from the device */
|
/* try to read the software revision (read the CMD reg) from the device */
|
||||||
i2c_read_reg(i2c, dev->addr, REG_CMD, &rev);
|
i2c_read_reg(i2c, dev->addr, REG_CMD, &rev);
|
||||||
if (rev == 0 || rev == 255) {
|
if (rev == 0 || rev == 255) {
|
||||||
|
i2c_release(dev->i2c);
|
||||||
DEBUG("[srf02] error reading the devices software revision\n");
|
DEBUG("[srf02] error reading the devices software revision\n");
|
||||||
return -1;
|
return -1;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user