diff options
author | barthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2011-07-11 19:49:14 +0000 |
---|---|---|
committer | barthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2011-07-11 19:49:14 +0000 |
commit | 0ada09b54288d8d632dad6cb4149234ccea34c43 (patch) | |
tree | 4222777461425b3a95a9e4f25ea334cf757ed101 /os/hal/src/i2c.c | |
parent | caeaf6536e6d9dc087d9a23ff71c442cd2762e63 (diff) | |
download | ChibiOS-0ada09b54288d8d632dad6cb4149234ccea34c43.tar.gz ChibiOS-0ada09b54288d8d632dad6cb4149234ccea34c43.tar.bz2 ChibiOS-0ada09b54288d8d632dad6cb4149234ccea34c43.zip |
I2C. Code clean ups.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/i2c_dev@3151 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/src/i2c.c')
-rw-r--r-- | os/hal/src/i2c.c | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/os/hal/src/i2c.c b/os/hal/src/i2c.c index 4c9a46e5e..cd12d42eb 100644 --- a/os/hal/src/i2c.c +++ b/os/hal/src/i2c.c @@ -165,18 +165,8 @@ void i2cMasterTransmit(I2CDriver *i2cp, /* init slave config field in driver */
i2cp->id_slave_config = i2cscfg;
-#if CH_DBG_ENABLE_ASSERTS
i2c_lld_wait_bus_free(i2cp);
- if(i2c_lld_bus_is_busy(i2cp)) { /* Probably slave locks up and need reset. */
-#ifdef PRINTTRACE
- print("I2C Bus busy!\n");
- return;
-#else
- /* the time is out. Probably slave locks up. */
- chDbgAssert(FALSE, "i2cMasterTransmit(), #1", "time is out");
-#endif /* PRINTTRACE */
- };
-#endif /* CH_DBG_ENABLE_ASSERTS */
+ chDbgAssert(!(i2c_lld_bus_is_busy(i2cp)), "i2cMasterReceive(), #1", "time is out");
chDbgAssert(i2cp->id_state == I2C_READY,
"i2cMasterTransmit(), #1", "not ready");
@@ -212,17 +202,8 @@ void i2cMasterReceive(I2CDriver *i2cp, /* init slave config field in driver */
i2cp->id_slave_config = i2cscfg;
-#if CH_DBG_ENABLE_ASSERTS
i2c_lld_wait_bus_free(i2cp);
- if(i2c_lld_bus_is_busy(i2cp)) {
-#ifdef PRINTTRACE
- print("I2C Bus busy!\n");
- return;
-#else
- chDbgAssert(FALSE, "i2cMasterReceive(), #1", "time is out");
-#endif /* PRINTTRACE */
- };
-#endif /* CH_DBG_ENABLE_ASSERTS */
+ chDbgAssert(!(i2c_lld_bus_is_busy(i2cp)), "i2cMasterReceive(), #1", "time is out");
chDbgAssert(i2cp->id_state == I2C_READY,
"i2cMasterReceive(), #1", "not ready");
|