aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/platforms/STM32/i2c_lld.c
diff options
context:
space:
mode:
authorbarthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-08-23 08:11:23 +0000
committerbarthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-08-23 08:11:23 +0000
commit4ec82f62c18894d92bafc6c6f98784650106373d (patch)
treea0cec5585dff0434608241c373b9ad30af5ae869 /os/hal/platforms/STM32/i2c_lld.c
parentc877f5bfcc5301b441c9b13e8c32d83e9df04f37 (diff)
parent2a494cb534dbe3535a9bf4c61dfbc8b6c9e750be (diff)
downloadChibiOS-4ec82f62c18894d92bafc6c6f98784650106373d.tar.gz
ChibiOS-4ec82f62c18894d92bafc6c6f98784650106373d.tar.bz2
ChibiOS-4ec82f62c18894d92bafc6c6f98784650106373d.zip
I2C. 1 - Merge code from trunk. 2 - Fix driver problems detected by the CH_DBG_SYSTEM_STATE_CHECK
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/i2c_dev@3249 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/platforms/STM32/i2c_lld.c')
-rw-r--r--os/hal/platforms/STM32/i2c_lld.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/os/hal/platforms/STM32/i2c_lld.c b/os/hal/platforms/STM32/i2c_lld.c
index a93e2f0a1..77d4b7829 100644
--- a/os/hal/platforms/STM32/i2c_lld.c
+++ b/os/hal/platforms/STM32/i2c_lld.c
@@ -514,10 +514,6 @@ void i2c_lld_init(void) {
* @param[in] i2cp pointer to the @p I2CDriver object
*/
void i2c_lld_start(I2CDriver *i2cp) {
-#if (!(STM32_I2C_I2C2_USE_POLLING_WAIT) && I2C_SUPPORTS_CALLBACKS)
- gptStart(i2cp->timer, i2cp->timer_cfg);
-#endif /* !(STM32_I2C_I2C2_USE_POLLING_WAIT) */
-
if (i2cp->id_state == I2C_STOP) { /* If in stopped state then enables the I2C clock.*/
#if STM32_I2C_USE_I2C1
if (&I2CD1 == i2cp) {
@@ -726,7 +722,7 @@ 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){
- gptStartOneShot(i2cp->timer, I2C_STOP_GPT_TIMEOUT);
+ gptStartOneShotI(i2cp->timer, I2C_STOP_GPT_TIMEOUT);
i2cp->flags |= I2C_FLG_TIMER_ARMED;
return;
}
@@ -784,7 +780,7 @@ 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){
- gptStartOneShot(i2cp->timer, I2C_STOP_GPT_TIMEOUT);
+ gptStartOneShotI(i2cp->timer, I2C_STOP_GPT_TIMEOUT);
i2cp->flags |= I2C_FLG_TIMER_ARMED;
return;
}
@@ -850,7 +846,7 @@ 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){
- gptStartOneShot(i2cp->timer, I2C_START_GPT_TIMEOUT);
+ gptStartOneShotI(i2cp->timer, I2C_START_GPT_TIMEOUT);
i2cp->flags |= I2C_FLG_TIMER_ARMED;
return;
}