summaryrefslogtreecommitdiff
path: root/n/avr/twi-master/test_twi_master.c
diff options
context:
space:
mode:
Diffstat (limited to 'n/avr/twi-master/test_twi_master.c')
-rw-r--r--n/avr/twi-master/test_twi_master.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/n/avr/twi-master/test_twi_master.c b/n/avr/twi-master/test_twi_master.c
index dbce0ad..9b8adac 100644
--- a/n/avr/twi-master/test_twi_master.c
+++ b/n/avr/twi-master/test_twi_master.c
@@ -19,6 +19,8 @@ void proto_callback (uint8_t cmd, uint8_t size, uint8_t *args)
{
proto_send ('s', 0, 0);
twi_master_send (args[0], &args[1], 1);
+ while (!twi_master_is_finished ())
+ ;
proto_send ('f', 0, 0);
}
else
@@ -32,7 +34,11 @@ void proto_callback (uint8_t cmd, uint8_t size, uint8_t *args)
if (c != 0)
proto_send ('e', 1 , 0);
else
+ {
+ while (!twi_master_is_finished ())
+ ;
proto_send ('f', 1, data);
+ }
}
else
proto_send ('e', 1, 0);