From 62ffe525e0e399f6ca821be9272b4f57aca8009c Mon Sep 17 00:00:00 2001 From: Jonathan Struebel Date: Fri, 8 Apr 2016 19:15:52 -0700 Subject: [KINETIS] Fix I2C TX to not wait for RX if requested rxbytes is 0 --- os/hal/ports/KINETIS/LLD/hal_i2c_lld.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/os/hal/ports/KINETIS/LLD/hal_i2c_lld.c b/os/hal/ports/KINETIS/LLD/hal_i2c_lld.c index 3659a93..1095737 100644 --- a/os/hal/ports/KINETIS/LLD/hal_i2c_lld.c +++ b/os/hal/ports/KINETIS/LLD/hal_i2c_lld.c @@ -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)); -- cgit v1.2.3