1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-17 05:32:45 +01:00

cpu/stm32_common/i2c: Fix return error code

This commit is contained in:
MrKevinWeiss 2018-06-29 13:10:40 +02:00 committed by dylad
parent 238b4dda2f
commit e8c56ceadc

View File

@ -436,7 +436,7 @@ static int _start(I2C_TypeDef *i2c, uint8_t address, uint8_t rw_flag, uint8_t fl
while (!(i2c->SR1 & I2C_SR1_ADDR) && tick--) {
if ((i2c->SR1 & ERROR_FLAG) || !tick) {
i2c->CR1 |= I2C_CR1_STOP;
return -ETIMEDOUT;
return -EIO;
}
}
@ -500,7 +500,7 @@ static inline int _wait_ready(I2C_TypeDef *i2c)
while ((i2c->SR2 & I2C_SR2_BUSY) && tick--) {
if (!tick) {
DEBUG("[i2c] wait_ready: timeout\n");
return -EIO;
return -ETIMEDOUT;
}
}