summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--n/avr/twi-master/twi_master.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/n/avr/twi-master/twi_master.c b/n/avr/twi-master/twi_master.c
index 932eff3..d0c7c73 100644
--- a/n/avr/twi-master/twi_master.c
+++ b/n/avr/twi-master/twi_master.c
@@ -184,7 +184,7 @@ SIGNAL (SIG_2WIRE_SERIAL)
case TW_MR_DATA_ACK:
buffer[twi_idx ++] = TWDR;
TWI_DEBUG ('n');
- if (twi_idx == twi_len)
+ if (twi_idx == (twi_len - 1))
TWCR &= ~ _BV (TWEA);
break;
case TW_MR_DATA_NACK: /* dernier byte */