Clear I2C data register on transmit failure
This commit is contained in:
parent
ef18028fe7
commit
047f1f0025
@ -34,6 +34,7 @@ int8_t i2c_transmit(uint8_t address, uint8_t *buffer, int len)
|
||||
}
|
||||
}
|
||||
LL_I2C_ClearFlag_STOP(i2c_context->i2c);
|
||||
LL_I2C_ClearFlag_TXE(i2c_context->i2c);
|
||||
if (len != i) {
|
||||
/* If we detect NACK during transaction (before the end of the last byte) */
|
||||
return I2C_ERROR_TX_INCOMPLETE;
|
||||
|
Loading…
Reference in New Issue
Block a user