From 72266f8b591c6e7857f4578ba753eeea7222ac6b Mon Sep 17 00:00:00 2001 From: barthess Date: Sat, 31 Dec 2011 09:40:52 +0000 Subject: I2C. Fixes. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3694 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/src/i2c.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'os/hal/src') diff --git a/os/hal/src/i2c.c b/os/hal/src/i2c.c index f48ca9e7e..841349be4 100644 --- a/os/hal/src/i2c.c +++ b/os/hal/src/i2c.c @@ -78,7 +78,6 @@ void i2cObjectInit(I2CDriver *i2cp) { i2cp->id_state = I2C_STOP; i2cp->id_config = NULL; i2cp->rxbuf = NULL; - i2cp->txbuf = NULL; i2cp->id_thread = NULL; #if I2C_USE_MUTUAL_EXCLUSION @@ -179,7 +178,7 @@ i2cflags_t i2cGetErrors(I2CDriver *i2cp) { */ msg_t i2cMasterTransmitTimeout(I2CDriver *i2cp, i2caddr_t addr, - uint8_t *txbuf, + const uint8_t *txbuf, size_t txbytes, uint8_t *rxbuf, size_t rxbytes, @@ -202,10 +201,7 @@ msg_t i2cMasterTransmitTimeout(I2CDriver *i2cp, rxbuf, rxbytes, timeout); i2cp->id_state = I2C_READY; chSysUnlock(); - if (i2cGetErrors(i2cp) != I2CD_NO_ERROR) - return RDY_RESET; - else - return rdymsg; + return rdymsg; } /** @@ -252,10 +248,7 @@ msg_t i2cMasterReceiveTimeout(I2CDriver *i2cp, rdymsg = i2c_lld_master_receive_timeout(i2cp, addr, rxbuf, rxbytes, timeout); i2cp->id_state = I2C_READY; chSysUnlock(); - if (i2cGetErrors(i2cp) != I2CD_NO_ERROR) - return RDY_RESET; - else - return rdymsg; + return rdymsg; } #if I2C_USE_MUTUAL_EXCLUSION || defined(__DOXYGEN__) -- cgit v1.2.3