From: Keith Packard Date: Thu, 5 Nov 2009 05:29:37 +0000 (-0800) Subject: In packet master, move USB flush from packet thread to echo thread X-Git-Tag: debian/0.6+27+gb0d7e3f~18 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=bc62bb254085cc705203b57260c04ac5e14c6611 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 --- 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;