diff options
author | Fabio Utzig <utzig@utzig.org> | 2016-04-09 09:25:46 -0300 |
---|---|---|
committer | Fabio Utzig <utzig@utzig.org> | 2016-04-09 09:25:46 -0300 |
commit | 03a3309578f35a78d4e7914e7aef0a5bf828321f (patch) | |
tree | 81e96d4bebd0669b4fa0a8327d187f7674111e27 | |
parent | 9d74dd2661b80a5ae8598591f0251b197cc51756 (diff) | |
parent | 62ffe525e0e399f6ca821be9272b4f57aca8009c (diff) | |
download | ChibiOS-Contrib-03a3309578f35a78d4e7914e7aef0a5bf828321f.tar.gz ChibiOS-Contrib-03a3309578f35a78d4e7914e7aef0a5bf828321f.tar.bz2 ChibiOS-Contrib-03a3309578f35a78d4e7914e7aef0a5bf828321f.zip |
Merge pull request #53 from jstruebel/master
[KINETIS] Fix I2C TX to not wait for RX if requested rxbytes is 0
-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));
|