diff options
author | barthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2011-06-30 21:37:34 +0000 |
---|---|---|
committer | barthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2011-06-30 21:37:34 +0000 |
commit | 551a1c1f22fb53085ab9485115fc3d27af92083c (patch) | |
tree | 4c67585a484c5ef19a18310d85dda1358c896bd5 /os/hal/include/i2c.h | |
parent | f73960c8dcbcc2f4f4b4aba8599a45485038ec82 (diff) | |
download | ChibiOS-551a1c1f22fb53085ab9485115fc3d27af92083c.tar.gz ChibiOS-551a1c1f22fb53085ab9485115fc3d27af92083c.tar.bz2 ChibiOS-551a1c1f22fb53085ab9485115fc3d27af92083c.zip |
I2C. Added dirty hack to realize thread safe dirver. Needs to be rewrited.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/i2c_dev@3100 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/include/i2c.h')
-rw-r--r-- | os/hal/include/i2c.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/os/hal/include/i2c.h b/os/hal/include/i2c.h index 953bd88dd..60b2c322d 100644 --- a/os/hal/include/i2c.h +++ b/os/hal/include/i2c.h @@ -210,10 +210,16 @@ struct I2CSlaveConfig{ (i2cp)->id_state = I2C_COMPLETE; \
if(((i2cp)->id_slave_config)->id_callback) { \
((i2cp)->id_slave_config)->id_callback(i2cp, i2cscfg); \
+ if((i2cp)->id_state == I2C_COMPLETE) \
+ (i2cp)->id_state = I2C_READY; \
} \
+ else \
+ (i2cp)->id_state = I2C_READY; \
_i2c_wakeup_isr(i2cp); \
+ i2cReleaseBus(i2cp); \
}
+
/*===========================================================================*/
/* External declarations. */
/*===========================================================================*/
|