aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/src
diff options
context:
space:
mode:
authorbarthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-04-02 09:33:46 +0000
committerbarthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-04-02 09:33:46 +0000
commit57fb5e703ba8ab824d1849d7436abd64684caf20 (patch)
tree87ba0cbbd7696882d170c98e0bc34523f08601fd /os/hal/src
parent573b5e875bd8431963fc3a40885020f7e3310640 (diff)
downloadChibiOS-57fb5e703ba8ab824d1849d7436abd64684caf20.tar.gz
ChibiOS-57fb5e703ba8ab824d1849d7436abd64684caf20.tar.bz2
ChibiOS-57fb5e703ba8ab824d1849d7436abd64684caf20.zip
I2C. Additional locks added to avoiding system hangups. Some mistypes in comments fixed.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/i2c_dev@2865 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/src')
-rw-r--r--os/hal/src/i2c.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/os/hal/src/i2c.c b/os/hal/src/i2c.c
index 11d4fccfa..ad9a5d0ac 100644
--- a/os/hal/src/i2c.c
+++ b/os/hal/src/i2c.c
@@ -138,7 +138,9 @@ void i2cMasterStart(I2CDriver *i2cp){
chDbgCheck((i2cp != NULL), "i2cMasterTransmit");
+ chSysLock();
i2c_lld_master_start(i2cp);
+ chSysUnlock();
}
/**
@@ -149,8 +151,9 @@ void i2cMasterStart(I2CDriver *i2cp){
void i2cMasterStop(I2CDriver *i2cp){
chDbgCheck((i2cp != NULL), "i2cMasterTransmit");
-
+ chSysLock();
i2c_lld_master_stop(i2cp);
+ chSysUnlock();
}
/**
@@ -168,7 +171,9 @@ void i2cMasterTransmit(I2CDriver *i2cp, I2CSlaveConfig *i2cscfg) {
"i2cMasterTransmit(), #1",
"not active");
+ chSysLock();
i2c_lld_master_transmit(i2cp, i2cscfg);
+ chSysUnlock();
}
@@ -186,7 +191,9 @@ void i2cMasterReceive(I2CDriver *i2cp, I2CSlaveConfig *i2cscfg) {
"i2cMasterReceive(), #1",
"not active");
+ chSysLock();
i2c_lld_master_receive(i2cp, i2cscfg);
+ chSysUnlock();
}