From 7b0c03739d6ac095c305de86e5df4d79dd339e5c Mon Sep 17 00:00:00 2001 From: demonchy Date: Sun, 17 Apr 2005 02:04:50 +0000 Subject: Condition de fin de receive modifiée --- n/avr/twi-master/twi_master.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'n') diff --git a/n/avr/twi-master/twi_master.c b/n/avr/twi-master/twi_master.c index 1718c7a..932eff3 100644 --- a/n/avr/twi-master/twi_master.c +++ b/n/avr/twi-master/twi_master.c @@ -15,7 +15,11 @@ enum TWI_ECHEC }; +#if 0 #define TWI_DEBUG(x) rs232_putc (x) +#else +#define TWI_DEBUG(x) +#endif #define NB_ITER_WAIT 40000 #define NB_RETRY 5 @@ -180,7 +184,7 @@ SIGNAL (SIG_2WIRE_SERIAL) case TW_MR_DATA_ACK: buffer[twi_idx ++] = TWDR; TWI_DEBUG ('n'); - if (twi_idx == (twi_len - 1)) + if (twi_idx == twi_len) TWCR &= ~ _BV (TWEA); break; case TW_MR_DATA_NACK: /* dernier byte */ -- cgit v1.2.3