diff options
author | barthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2011-08-05 17:24:23 +0000 |
---|---|---|
committer | barthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2011-08-05 17:24:23 +0000 |
commit | 6ee04cf23282fff92b088ac6f408e5233eb3aa75 (patch) | |
tree | 4d1e7e5d7611dc0e26f277486adb91c00e036352 /os/hal/src/i2c.c | |
parent | 4bcff1c283004b10e7a39e855da996621f9eec6d (diff) | |
download | ChibiOS-6ee04cf23282fff92b088ac6f408e5233eb3aa75.tar.gz ChibiOS-6ee04cf23282fff92b088ac6f408e5233eb3aa75.tar.bz2 ChibiOS-6ee04cf23282fff92b088ac6f408e5233eb3aa75.zip |
I2C. Added template of synchronouse deriver. It does not work for a moment.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/i2c_dev@3190 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/src/i2c.c')
-rw-r--r-- | os/hal/src/i2c.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/os/hal/src/i2c.c b/os/hal/src/i2c.c index b233764f5..9676a3250 100644 --- a/os/hal/src/i2c.c +++ b/os/hal/src/i2c.c @@ -178,7 +178,11 @@ void i2cMasterTransmit(I2CDriver *i2cp, i2cp->id_state = I2C_ACTIVE_TRANSMIT;
i2c_lld_master_transmit(i2cp, slave_addr, txbuf, txbytes, rxbuf, rxbytes);
+#if I2C_SUPPORTS_CALLBACKS
_i2c_wait_s(i2cp);
+#else
+ i2cp->id_state = I2C_READY;
+#endif /* I2C_SUPPORTS_CALLBACKS */
}
/**
@@ -216,7 +220,11 @@ void i2cMasterReceive(I2CDriver *i2cp, i2cp->id_state = I2C_ACTIVE_RECEIVE;
i2c_lld_master_receive(i2cp, slave_addr, rxbuf, rxbytes);
+#if I2C_SUPPORTS_CALLBACKS
_i2c_wait_s(i2cp);
+#else
+ i2cp->id_state = I2C_READY;
+#endif /* I2C_SUPPORTS_CALLBACKS */
}
|