summaryrefslogtreecommitdiff
path: root/n
diff options
context:
space:
mode:
Diffstat (limited to 'n')
-rw-r--r--n/avr/twi-master/twi_master.c6
1 files changed, 3 insertions, 3 deletions
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;