summaryrefslogtreecommitdiff
path: root/src/ao_packet_master.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2010-08-29 22:41:18 -0700
committerKeith Packard <keithp@keithp.com>2010-08-29 22:41:18 -0700
commitc4a8569f61eddf690d00337543462235ecbfbe54 (patch)
treedc910c4395bbd10ee9f16e2e877e6b49f5d84a94 /src/ao_packet_master.c
parent1acd3c7ec167b1b18e4ea493e5978c938a91cc89 (diff)
altos: flush pending output when terminating packet mode
Just in case the last command sent hasn't been transmitted, hang around for up to a second waiting for the data to get across the link. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/ao_packet_master.c')
-rw-r--r--src/ao_packet_master.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/ao_packet_master.c b/src/ao_packet_master.c
index 72bb908a..5e13a91a 100644
--- a/src/ao_packet_master.c
+++ b/src/ao_packet_master.c
@@ -121,6 +121,10 @@ ao_packet_forward(void) __reentrant
if (c == '\r') c = '\n';
ao_packet_putchar(c);
}
+
+ /* Wait for a second if there is any pending data */
+ for (c = 0; (ao_packet_tx_used || ao_tx_packet.len) && c < 10; c++)
+ ao_delay(AO_MS_TO_TICKS(100));
ao_packet_enable = 0;
ao_radio_abort();
while (ao_packet_echo_task.wchan || ao_packet_task.wchan) {