From 6bd662cfb2d90628eb03c0bec1ebac54e47a7090 Mon Sep 17 00:00:00 2001 From: px4dev Date: Sat, 26 Jan 2013 16:11:31 -0800 Subject: 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. --- apps/px4io/i2c.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'apps/px4io/i2c.c') 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(); -- cgit v1.2.3