From f54c30633f1b679679d09214e23cb7cf8474d3c5 Mon Sep 17 00:00:00 2001 From: demonchy Date: Sun, 17 Apr 2005 01:42:57 +0000 Subject: Correction d'un bug de multibyte --- n/avr/twi-master/twi_master.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'n') diff --git a/n/avr/twi-master/twi_master.c b/n/avr/twi-master/twi_master.c index ab53b6e..1b7aea2 100644 --- a/n/avr/twi-master/twi_master.c +++ b/n/avr/twi-master/twi_master.c @@ -25,7 +25,7 @@ static uint8_t twi_dest_addr; static uint8_t twi_len; static uint8_t twi_idx; static uint8_t twi_nb_retry; -uint8_t twi_state = TWI_FREE; +volatile uint8_t twi_state = TWI_FREE; #define SYSCLK 14745600UL @@ -176,9 +176,9 @@ SIGNAL (SIG_2WIRE_SERIAL) break; case TW_MR_DATA_ACK: buffer[twi_idx ++] = TWDR; - TWI_DEBUG ('n'); + TWI_DEBUG ('n'); if (twi_idx == (twi_len - 1)) - TWCR |= _BV (TWEA); + TWCR &= ~ _BV (TWEA); break; case TW_MR_DATA_NACK: /* dernier byte */ twi_state = TWI_SUCCESS; -- cgit v1.2.3