From ebeb13688a9a5442c838641ede6ba0dc92c9a1a4 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Mon, 23 Aug 2010 14:32:58 -0700 Subject: altosui: Add debug dongle API, split flash UI out Create an API to talk through the debug port on another AltOS device. Split the flash UI out from the flash implementation so that a command line flash utility can be written. Signed-off-by: Keith Packard --- ao-tools/altosui/AltosSerial.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'ao-tools/altosui/AltosSerial.java') diff --git a/ao-tools/altosui/AltosSerial.java b/ao-tools/altosui/AltosSerial.java index ba00b55e..a62f1225 100644 --- a/ao-tools/altosui/AltosSerial.java +++ b/ao-tools/altosui/AltosSerial.java @@ -79,6 +79,10 @@ public class AltosSerial implements Runnable { } } + public void flush_reply() { + reply_queue.clear(); + } + public String get_reply() throws InterruptedException { return reply_queue.take(); } -- cgit v1.2.3 From c3f57ffdb6c74de90d982eacd604e658ce9b00a5 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Mon, 23 Aug 2010 22:01:11 -0700 Subject: altosui: flush serial output before waiting for reply --- ao-tools/altosui/AltosSerial.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'ao-tools/altosui/AltosSerial.java') diff --git a/ao-tools/altosui/AltosSerial.java b/ao-tools/altosui/AltosSerial.java index a62f1225..d02e25a9 100644 --- a/ao-tools/altosui/AltosSerial.java +++ b/ao-tools/altosui/AltosSerial.java @@ -84,7 +84,9 @@ public class AltosSerial implements Runnable { } public String get_reply() throws InterruptedException { - return reply_queue.take(); + libaltos.altos_flush(altos); + String line = reply_queue.take(); + return line; } public void add_monitor(LinkedBlockingQueue q) { -- cgit v1.2.3