altos: Clear packet queue when starting packet master
authorKeith Packard <keithp@keithp.com>
Mon, 25 Apr 2016 22:50:58 +0000 (18:50 -0400)
committerKeith Packard <keithp@keithp.com>
Mon, 25 Apr 2016 22:50:58 +0000 (18:50 -0400)
This avoids overfilling the packet buffer when
disconnected. Applications using packet mode shouldn't expect that
output be saved across master sessions.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/drivers/ao_packet_master.c

index 5e440db04776442dc0c516bdcdadb69f4ed8ce12..2beda4cbad865f066b047be61f912a4c3c19bd97 100644 (file)
@@ -117,6 +117,7 @@ ao_packet_forward(void) __reentrant
 {
        char c;
        ao_packet_enable = 1;
+       ao_packet_tx_used = 0;
        ao_cmd_white();
 
        flush();