aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/src
diff options
context:
space:
mode:
authorbarthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-07-01 13:36:59 +0000
committerbarthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-07-01 13:36:59 +0000
commitaf0e40079ded13b8842e8d129fa6ed2f37fdf678 (patch)
tree53189f84b2d636dd3c7757f4dc6df75106bcf750 /os/hal/src
parent551a1c1f22fb53085ab9485115fc3d27af92083c (diff)
downloadChibiOS-af0e40079ded13b8842e8d129fa6ed2f37fdf678.tar.gz
ChibiOS-af0e40079ded13b8842e8d129fa6ed2f37fdf678.tar.bz2
ChibiOS-af0e40079ded13b8842e8d129fa6ed2f37fdf678.zip
I2C. Trying to add optional WAIT support. Driver broken.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/i2c_dev@3101 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/src')
-rw-r--r--os/hal/src/i2c.c40
1 files changed, 18 insertions, 22 deletions
diff --git a/os/hal/src/i2c.c b/os/hal/src/i2c.c
index 725e92d65..3f4095aa3 100644
--- a/os/hal/src/i2c.c
+++ b/os/hal/src/i2c.c
@@ -156,8 +156,6 @@ void i2cMasterTransmit(I2CDriver *i2cp,
uint8_t *rxbuf,
size_t rxbytes) {
- i2cAcquireBus(i2cp);
-
chDbgCheck((i2cp != NULL) && (i2cscfg != NULL) &&\
(slave_addr != 0) &&\
(txbytes > 0) &&\
@@ -167,15 +165,15 @@ void i2cMasterTransmit(I2CDriver *i2cp,
/* init slave config field in driver */
i2cp->id_slave_config = i2cscfg;
-#if I2C_USE_WAIT
- i2c_lld_wait_bus_free(i2cp);
- if(i2c_lld_bus_is_busy(i2cp)) {
-#ifdef PRINTTRACE
- print("I2C Bus busy!\n");
-#endif
- return;
- };
-#endif
+//#if I2C_USE_WAIT
+// i2c_lld_wait_bus_free(i2cp);
+// if(i2c_lld_bus_is_busy(i2cp)) {
+//#ifdef PRINTTRACE
+// print("I2C Bus busy!\n");
+//#endif
+// return;
+// };
+//#endif
chSysLock();
chDbgAssert(i2cp->id_state == I2C_READY,
@@ -204,8 +202,6 @@ void i2cMasterReceive(I2CDriver *i2cp,
uint8_t *rxbuf,
size_t rxbytes){
- i2cAcquireBus(i2cp);
-
chDbgCheck((i2cp != NULL) && (i2cscfg != NULL) &&\
(slave_addr != 0) &&\
(rxbytes > 0) && \
@@ -215,15 +211,15 @@ void i2cMasterReceive(I2CDriver *i2cp,
/* init slave config field in driver */
i2cp->id_slave_config = i2cscfg;
-#if I2C_USE_WAIT
- i2c_lld_wait_bus_free(i2cp);
- if(i2c_lld_bus_is_busy(i2cp)) {
-#ifdef PRINTTRACE
- print("I2C Bus busy!\n");
-#endif
- return;
- };
-#endif
+//#if I2C_USE_WAIT
+// i2c_lld_wait_bus_free(i2cp);
+// if(i2c_lld_bus_is_busy(i2cp)) {
+//#ifdef PRINTTRACE
+// print("I2C Bus busy!\n");
+//#endif
+// return;
+// };
+//#endif
chSysLock();
chDbgAssert(i2cp->id_state == I2C_READY,