Fixed Repeated-start in I2C

This commit is contained in:
Efthymios Kalyviotis 2017-11-19 23:27:55 +02:00
parent 691cf4ed62
commit 0e6694144f

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