summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2010-11-22 15:53:27 -0800
committerKeith Packard <keithp@keithp.com>2010-11-22 15:53:27 -0800
commit68323cbb222f1f33198a42abaa0550af22f75a93 (patch)
tree8fd016b466ac2d1b456538366dba46019d752f78
parent377ee7e90ecd028f984cd1abce96b2efc3b5b977 (diff)
altosui: Close serial port when debug link fails
If the debug connection isn't working, close down the serial port when reporting the failure. Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r--ao-tools/altosui/AltosFlash.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/ao-tools/altosui/AltosFlash.java b/ao-tools/altosui/AltosFlash.java
index fa2465d3..3af25c23 100644
--- a/ao-tools/altosui/AltosFlash.java
+++ b/ao-tools/altosui/AltosFlash.java
@@ -336,7 +336,9 @@ public class AltosFlash {
debug = new AltosDebug(in_debug_dongle);
input = new FileInputStream(file);
image = new AltosHexfile(input);
- if (!debug.check_connection())
+ if (!debug.check_connection()) {
+ debug.close();
throw new IOException("Debug port not connected");
+ }
}
} \ No newline at end of file