From: Keith Packard Date: Thu, 5 Nov 2009 05:59:12 +0000 (-0800) Subject: Flush pending input when switching to remote packet mode X-Git-Tag: debian/0.6+27+gb0d7e3f~15 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=843ee489aac34ad6d81f55f1c85fb9eecc42d86b Flush pending input when switching to remote packet mode Any pending input would just confuse the application, so pull it off the link and dump it. Signed-off-by: Keith Packard --- diff --git a/ao-tools/lib/cc-usb.c b/ao-tools/lib/cc-usb.c index 9b3b831f..53a50741 100644 --- a/ao-tools/lib/cc-usb.c +++ b/ao-tools/lib/cc-usb.c @@ -378,7 +378,7 @@ void cc_usb_open_remote(struct cc_usb *cc) { if (!cc->remote) { - cc_usb_printf(cc, "p\nE 0\n"); + cc_usb_printf(cc, "\np\nE 0\n"); do { cc->in_count = cc->in_pos = 0; _cc_usb_sync(cc, 100); @@ -419,7 +419,7 @@ cc_usb_open(char *tty) save_termios = termios; cfmakeraw(&termios); tcsetattr(cc->fd, TCSAFLUSH, &termios); - cc_usb_printf(cc, "E 0\nm 0\n"); + cc_usb_printf(cc, "\nE 0\nm 0\n"); do { cc->in_count = cc->in_pos = 0; _cc_usb_sync(cc, 100);