diff options
author | Alex Ong <the.onga@gmail.com> | 2019-01-26 11:36:28 +1100 |
---|---|---|
committer | Alex Ong <the.onga@gmail.com> | 2019-01-26 11:36:28 +1100 |
commit | d977daa8dc9136746425f9e1414e1f93cb161877 (patch) | |
tree | 209ab8082580e5fdf37f1a8b7c1169250b7548c0 /drivers/avr/i2c_master.c | |
parent | 47c91fc7f75ae0a477e55b687aa0fc30da0a283c (diff) | |
parent | 0306e487e2cd6a77ad840d0a441b478747b7ccd0 (diff) |
Merge branch 'master' of https://github.com/qmk/qmk_firmware
Diffstat (limited to 'drivers/avr/i2c_master.c')
-rwxr-xr-x | drivers/avr/i2c_master.c | 5 |
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 +} |