summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/arm/at91/at91_twi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/arm/at91/at91_twi.c b/sys/arm/at91/at91_twi.c
index 33ef8c0..6442d07 100644
--- a/sys/arm/at91/at91_twi.c
+++ b/sys/arm/at91/at91_twi.c
@@ -348,7 +348,7 @@ at91_twi_transfer(device_t dev, struct iic_msg *msgs, uint32_t nmsgs)
if ((sr = RD4(sc, TWI_SR)) & TWI_SR_RXRDY) {
len--;
*buf++ = RD4(sc, TWI_RHR) & 0xff;
- if (len == 0 && msgs[i].len != 1)
+ if (len == 1)
WR4(sc, TWI_CR, TWI_CR_STOP);
}
}
OpenPOWER on IntegriCloud