diff options
author | Jonathan Struebel <jonathan.struebel@gmail.com> | 2016-04-08 19:15:52 -0700 |
---|---|---|
committer | Jonathan Struebel <jonathan.struebel@gmail.com> | 2016-04-08 19:24:47 -0700 |
commit | 62ffe525e0e399f6ca821be9272b4f57aca8009c (patch) | |
tree | 81e96d4bebd0669b4fa0a8327d187f7674111e27 /os/hal/ports/KINETIS | |
parent | 9d74dd2661b80a5ae8598591f0251b197cc51756 (diff) | |
download | ChibiOS-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')
-rw-r--r-- | os/hal/ports/KINETIS/LLD/hal_i2c_lld.c | 2 |
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));
|