diff options
author | barthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2011-07-01 13:36:59 +0000 |
---|---|---|
committer | barthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2011-07-01 13:36:59 +0000 |
commit | af0e40079ded13b8842e8d129fa6ed2f37fdf678 (patch) | |
tree | 53189f84b2d636dd3c7757f4dc6df75106bcf750 /os/hal/include | |
parent | 551a1c1f22fb53085ab9485115fc3d27af92083c (diff) | |
download | ChibiOS-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/include')
-rw-r--r-- | os/hal/include/i2c.h | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/os/hal/include/i2c.h b/os/hal/include/i2c.h index 60b2c322d..0a4ba8b53 100644 --- a/os/hal/include/i2c.h +++ b/os/hal/include/i2c.h @@ -165,9 +165,9 @@ struct I2CSlaveConfig{ * @notapi
*/
#define _i2c_wait_s(i2cp) { \
- chDbgAssert((i2cp)->thread == NULL, \
+ chDbgAssert((i2cp)->id_thread == NULL, \
"_i2c_wait(), #1", "already waiting"); \
- (i2cp)->thread = chThdSelf(); \
+ (i2cp)->id_thread = chThdSelf(); \
chSchGoSleepS(THD_STATE_SUSPENDED); \
}
@@ -179,9 +179,9 @@ struct I2CSlaveConfig{ * @notapi
*/
#define _i2c_wakeup_isr(i2cp) { \
- if ((i2cp)->thread != NULL) { \
- Thread *tp = (i2cp)->thread; \
- (i2cp)->thread = NULL; \
+ if ((i2cp)->id_thread != NULL) { \
+ Thread *tp = (i2cp)->id_thread; \
+ (i2cp)->id_thread = NULL; \
chSysLockFromIsr(); \
chSchReadyI(tp); \
chSysUnlockFromIsr(); \
@@ -216,7 +216,6 @@ struct I2CSlaveConfig{ else \
(i2cp)->id_state = I2C_READY; \
_i2c_wakeup_isr(i2cp); \
- i2cReleaseBus(i2cp); \
}
|