From 843ee489aac34ad6d81f55f1c85fb9eecc42d86b Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Wed, 4 Nov 2009 21:59:12 -0800 Subject: [PATCH] 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 --- ao-tools/lib/cc-usb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); -- 2.30.2