Merge pull request #486 from ekalyvio/master

Fixed Repeated-start in I2C
This commit is contained in:
Ruslan V. Uss 2017-12-02 14:45:46 +05:00 committed by GitHub
commit f67495f4f0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -344,8 +344,6 @@ int i2c_slave_read(uint8_t bus, uint8_t slave_addr, const uint8_t *data, uint8_t
goto error; goto error;
if (!i2c_write(bus, *data)) if (!i2c_write(bus, *data))
goto error; goto error;
if (!i2c_stop(bus))
goto error;
} }
i2c_start(bus); i2c_start(bus);
if (!i2c_write(bus, slave_addr << 1 | 1)) // Slave address + read if (!i2c_write(bus, slave_addr << 1 | 1)) // Slave address + read