From bc62bb254085cc705203b57260c04ac5e14c6611 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Wed, 4 Nov 2009 21:29:37 -0800 Subject: [PATCH] In packet master, move USB flush from packet thread to echo thread This keeps the packet thread from blocking on USB and also makes the flush happen after every packet (slightly more USB traffic, but packets are slow anyway). Signed-off-by: Keith Packard --- src/ao_packet_master.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/ao_packet_master.c b/src/ao_packet_master.c index 2751f414..d03899d1 100644 --- a/src/ao_packet_master.c +++ b/src/ao_packet_master.c @@ -27,6 +27,7 @@ ao_packet_getchar(void) break; if (ao_packet_master_sleeping) ao_wake_task(&ao_packet_task); + flush(); ao_sleep(&ao_stdin_ready); } return c; @@ -94,8 +95,6 @@ ao_packet_master(void) continue; if (ao_rx_packet.packet.len) ao_packet_master_busy(); - else - flush(); ao_packet_master_sleeping = 1; ao_delay(ao_packet_master_delay); ao_packet_master_sleeping = 0; -- 2.30.2