aboutsummaryrefslogtreecommitdiff
path: root/apps/px4io/i2c.c
diff options
context:
space:
mode:
authorpx4dev <px4@purgatory.org>2013-01-26 16:11:31 -0800
committerpx4dev <px4@purgatory.org>2013-01-26 16:11:31 -0800
commit6bd662cfb2d90628eb03c0bec1ebac54e47a7090 (patch)
tree46a0842c80cc3b9ed26b2936d50d3e8443f6b38c /apps/px4io/i2c.c
parente0f83af96fdab2cd5b239dec3a842c4a2a92ad85 (diff)
downloadpx4-firmware-6bd662cfb2d90628eb03c0bec1ebac54e47a7090.tar.gz
px4-firmware-6bd662cfb2d90628eb03c0bec1ebac54e47a7090.tar.bz2
px4-firmware-6bd662cfb2d90628eb03c0bec1ebac54e47a7090.zip
In the case of a repeated start, we won't get a STOPF/AF status, but we still need to complete the old transaction before handling ADDR.
Diffstat (limited to 'apps/px4io/i2c.c')
-rw-r--r--apps/px4io/i2c.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/apps/px4io/i2c.c b/apps/px4io/i2c.c
index c16d5700c..2b8c502c7 100644
--- a/apps/px4io/i2c.c
+++ b/apps/px4io/i2c.c
@@ -157,7 +157,7 @@ i2c_interrupt(int irq, FAR void *context)
{
uint16_t sr1 = rSR1;
- if (sr1 & (I2C_SR1_STOPF | I2C_SR1_AF)) {
+ if (sr1 & (I2C_SR1_STOPF | I2C_SR1_AF | I2C_SR1_ADDR)) {
if (sr1 & I2C_SR1_STOPF) {
/* write to CR1 to clear STOPF */
@@ -165,7 +165,7 @@ i2c_interrupt(int irq, FAR void *context)
rCR1 |= I2C_CR1_PE;
}
- /* it's likely that the DMA hasn't stopped, so we have to do it here */
+ /* DMA never stops, so we should do that now */
switch (direction) {
case DIR_TX:
i2c_tx_complete();