summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rwxr-xr-xdrivers/avr/i2c_master.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/avr/i2c_master.c b/drivers/avr/i2c_master.c
index a04e6570d7..19bae33e9f 100755
--- a/drivers/avr/i2c_master.c
+++ b/drivers/avr/i2c_master.c
@@ -179,6 +179,9 @@ i2c_status_t i2c_readReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16
status = i2c_write(regaddr, timeout);
if (status) return status;
+ status = i2c_stop(timeout);
+ if (status) return status;
+
status = i2c_start(devaddr | 0x01, timeout);
if (status) return status;
@@ -217,4 +220,4 @@ i2c_status_t i2c_stop(uint16_t timeout)
}
return I2C_STATUS_SUCCESS;
-} \ No newline at end of file
+}