aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/ports/KINETIS/LLD
diff options
context:
space:
mode:
authorJonathan Struebel <jonathan.struebel@gmail.com>2016-04-08 19:15:52 -0700
committerJonathan Struebel <jonathan.struebel@gmail.com>2016-04-08 19:24:47 -0700
commit62ffe525e0e399f6ca821be9272b4f57aca8009c (patch)
tree81e96d4bebd0669b4fa0a8327d187f7674111e27 /os/hal/ports/KINETIS/LLD
parent9d74dd2661b80a5ae8598591f0251b197cc51756 (diff)
downloadChibiOS-Contrib-62ffe525e0e399f6ca821be9272b4f57aca8009c.tar.gz
ChibiOS-Contrib-62ffe525e0e399f6ca821be9272b4f57aca8009c.tar.bz2
ChibiOS-Contrib-62ffe525e0e399f6ca821be9272b4f57aca8009c.zip
[KINETIS] Fix I2C TX to not wait for RX if requested rxbytes is 0
Diffstat (limited to 'os/hal/ports/KINETIS/LLD')
-rw-r--r--os/hal/ports/KINETIS/LLD/hal_i2c_lld.c2
1 files changed, 1 insertions, 1 deletions
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));