summaryrefslogtreecommitdiff
path: root/n
diff options
context:
space:
mode:
Diffstat (limited to 'n')
-rw-r--r--n/avr/twi-master/twi_master.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/n/avr/twi-master/twi_master.c b/n/avr/twi-master/twi_master.c
index 9bde94c..ab53b6e 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 = 0;
+uint8_t twi_state = TWI_FREE;
#define SYSCLK 14745600UL
@@ -45,7 +45,7 @@ twi_master_init (void)
int8_t
twi_is_finished ()
{
- if (twi_state == TWI_SUCCESS)
+ if (twi_state == TWI_SUCCESS || twi_state == TWI_ECHEC)
return 1;
else
return 0;
@@ -68,7 +68,10 @@ twi_master_send (uint8_t addr, uint8_t *data, uint8_t len)
return 0;
}
else
+ {
+ TWI_DEBUG ('x');
return -1;
+ }
}
int8_t