Merge pull request #12007 from MrKevinWeiss/devfixi2cflag

cpu/stm32: Fix read bytes flag for i2c_2
This commit is contained in:
Sebastian Meiling 2019-10-17 09:14:26 +02:00 committed by GitHub
commit 742a23c75b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -218,6 +218,10 @@ int i2c_read_bytes(i2c_t dev, uint16_t address, void *data, size_t length,
I2C_TypeDef *i2c = i2c_config[dev].dev;
DEBUG("[i2c] read_bytes: Starting\n");
/* Do not support repeated start reading */
if ((i2c->SR2 & I2C_SR2_BUSY) && !(flags & I2C_NOSTART)) {
return -EOPNOTSUPP;
}
int ret = _start(i2c, (address << 1) | I2C_FLAG_READ, flags, length);
if (ret < 0) {
if (ret == -ETIMEDOUT) {