summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordemonchy2005-04-17 02:04:50 +0000
committerdemonchy2005-04-17 02:04:50 +0000
commit7b0c03739d6ac095c305de86e5df4d79dd339e5c (patch)
tree6c0cb6abf99ce034967e9e31ec55493bfea08f36
parent6c7ff75996f2f1659269168de880721487afbea0 (diff)
Condition de fin de receive modifiée
-rw-r--r--n/avr/twi-master/twi_master.c6
1 files changed, 5 insertions, 1 deletions
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 */