[KINETIS] Fix I2C TX to not wait for RX if requested rxbytes is 0

This commit is contained in:
Jonathan Struebel 2016-04-08 19:15:52 -07:00
parent 9d74dd2661
commit 62ffe525e0
1 changed files with 1 additions and 1 deletions

View File

@ -330,7 +330,7 @@ static inline msg_t _i2c_txrx_timeout(I2CDriver *i2cp, i2caddr_t addr,
//if (i2cp->i2c->S & I2Cx_S_RXAK)
// i2cp->errors |= I2C_ACK_FAILURE;
if (msg == MSG_OK && txbuf != NULL && rxbuf != NULL) {
if (msg == MSG_OK && txbuf != NULL && rxbuf != NULL && rxbytes > 0) {
i2cp->i2c->C1 |= I2Cx_C1_RSTA;
/* FIXME */
while (!(i2cp->i2c->S & I2Cx_S_BUSY));