diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2012-01-06 16:41:43 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2012-01-06 16:41:43 +0000 |
commit | dcbb613f6d74018abc0c977b351dbd9334d1454f (patch) | |
tree | fe7f67c991d894933379a02426b9bfd6b6fc271e | |
parent | 25238b87b5e39584590c3131e6695d0baf7a488f (diff) | |
download | ChibiOS-dcbb613f6d74018abc0c977b351dbd9334d1454f.tar.gz ChibiOS-dcbb613f6d74018abc0c977b351dbd9334d1454f.tar.bz2 ChibiOS-dcbb613f6d74018abc0c977b351dbd9334d1454f.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3750 35acf78f-673a-0410-8e92-d51de3d6d3f4
-rw-r--r-- | os/hal/platforms/STM32/i2c_lld.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/os/hal/platforms/STM32/i2c_lld.c b/os/hal/platforms/STM32/i2c_lld.c index 40732c122..f00dfdc89 100644 --- a/os/hal/platforms/STM32/i2c_lld.c +++ b/os/hal/platforms/STM32/i2c_lld.c @@ -305,10 +305,9 @@ static uint32_t i2c_get_event(I2CDriver *i2cp) { */ static void i2c_lld_serve_event_interrupt(I2CDriver *i2cp) { - /* Interrupts disabled just before dmaStreamEnable() because there is no - * need of interrupts until next transaction begin. All work - * will be done by DMA. */ - + /* Interrupts are disabled just before dmaStreamEnable() because there + is no need of interrupts until next transaction begin. All the work is + done by the DMA.*/ switch (i2c_get_event(i2cp)) { case I2C_EV5_MASTER_MODE_SELECT: i2cp->i2c->DR = i2cp->addr; @@ -316,7 +315,7 @@ static void i2c_lld_serve_event_interrupt(I2CDriver *i2cp) { case I2C_EV6_MASTER_REC_MODE_SELECTED: i2cp->i2c->CR2 &= ~I2C_CR2_ITEVTEN; dmaStreamEnable(i2cp->dmarx); - i2cp->i2c->CR2 |= I2C_CR2_LAST; /* need in receiver mode */ + i2cp->i2c->CR2 |= I2C_CR2_LAST; /* Needed in receiver mode. */ break; case I2C_EV6_MASTER_TRA_MODE_SELECTED: i2cp->i2c->CR2 &= ~I2C_CR2_ITEVTEN; @@ -387,9 +386,9 @@ static void i2c_lld_serve_tx_end_irq(I2CDriver *i2cp, uint32_t flags) { dmaStreamDisable(i2cp->dmatx); dmaStreamClearInterrupt(i2cp->dmatx); - /* Enable interrupts to catch BTF event meaning transmission part complete. - * Interrupt handler will decide to generate STOP or to begin receiving part - * of rw transaction itself. */ + /* Enables interrupts to catch BTF event meaning transmission part complete. + Interrupt handler will decide to generate STOP or to begin receiving part + of R/W transaction itself.*/ i2cp->i2c->CR2 |= I2C_CR2_ITEVTEN; } |