summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2009-11-04 21:29:37 -0800
committerKeith Packard <keithp@keithp.com>2009-11-04 21:29:37 -0800
commitbc62bb254085cc705203b57260c04ac5e14c6611 (patch)
tree3cc8e9ccb2d1b11a752379b25d797d11afa88ec3
parent27ebaf8e13aed06bb1ea6e770f767495a02be6c5 (diff)
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 <keithp@keithp.com>
-rw-r--r--src/ao_packet_master.c3
1 files changed, 1 insertions, 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;