aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal
diff options
context:
space:
mode:
authorbarthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-08-28 14:02:18 +0000
committerbarthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-08-28 14:02:18 +0000
commit076e7453bf812c59f38cda94dd0379b6f03af0d0 (patch)
treeb016ad12f47b5e115004774f2bb8aa8f16745db1 /os/hal
parentfc492c6d190610cc9537360edf44d6dc5d072a2c (diff)
downloadChibiOS-076e7453bf812c59f38cda94dd0379b6f03af0d0.tar.gz
ChibiOS-076e7453bf812c59f38cda94dd0379b6f03af0d0.tar.bz2
ChibiOS-076e7453bf812c59f38cda94dd0379b6f03af0d0.zip
I2C. Test updated.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/i2c_dev@3264 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal')
-rw-r--r--os/hal/platforms/STM32/i2c_lld.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/os/hal/platforms/STM32/i2c_lld.c b/os/hal/platforms/STM32/i2c_lld.c
index 9038d351f..d10cb4031 100644
--- a/os/hal/platforms/STM32/i2c_lld.c
+++ b/os/hal/platforms/STM32/i2c_lld.c
@@ -721,8 +721,10 @@ void i2c_lld_master_transmit(I2CDriver *i2cp, uint16_t slave_addr,
#else
chDbgAssert(!(i2cp->flags & I2C_FLG_TIMER_ARMED), "i2c_lld_master_transmit(), #1", "time to STOP is out");
if ((i2cp->id_i2c->CR1 & I2C_CR1_STOP) && i2cp->timer != NULL && i2cp->timer_cfg != NULL){
+ chSysLockFromIsr();
gptStartOneShotI(i2cp->timer, I2C_STOP_GPT_TIMEOUT);
i2cp->flags |= I2C_FLG_TIMER_ARMED;
+ chSysUnlockFromIsr();
return;
}
#endif /* STM32_I2C_I2C1_USE_POLLING_WAIT */
@@ -779,8 +781,10 @@ void i2c_lld_master_receive(I2CDriver *i2cp, uint16_t slave_addr,
#else
chDbgAssert(!(i2cp->flags & I2C_FLG_TIMER_ARMED), "i2c_lld_master_receive(), #1", "time to STOP is out");
if ((i2cp->id_i2c->CR1 & I2C_CR1_STOP) && i2cp->timer != NULL && i2cp->timer_cfg != NULL){
+ chSysLockFromIsr();
gptStartOneShotI(i2cp->timer, I2C_STOP_GPT_TIMEOUT);
i2cp->flags |= I2C_FLG_TIMER_ARMED;
+ chSysUnlockFromIsr();
return;
}
#endif /* STM32_I2C_I2C1_USE_POLLING_WAIT */
@@ -845,8 +849,10 @@ void i2c_lld_master_transceive(I2CDriver *i2cp){
#else
chDbgAssert(!(i2cp->flags & I2C_FLG_TIMER_ARMED), "i2c_lld_master_transceive(), #1", "time to START is out");
if ((i2cp->id_i2c->CR1 & I2C_CR1_START) && i2cp->timer != NULL && i2cp->timer_cfg != NULL){
+ chSysLockFromIsr();
gptStartOneShotI(i2cp->timer, I2C_START_GPT_TIMEOUT);
i2cp->flags |= I2C_FLG_TIMER_ARMED;
+ chSysUnlockFromIsr();
return;
}
#endif /* STM32_I2C_I2C1_USE_POLLING_WAIT */