diff --git a/sys/arm/at91/at91_twi.c b/sys/arm/at91/at91_twi.c index 33ef8c0a1435..6442d07315b4 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); } }