X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=altoslib%2FAltosFlash.java;h=95ea73b593626fd7c465b8a3286ffa1309b7a80c;hp=25c76863b6b037de0fbd50605cc49caa607fb647;hb=f822b84d8c25159ff113fef6a419b6e18e87a87a;hpb=b89fb51a963635e2effe3a31f803bfc29c2c46b7 diff --git a/altoslib/AltosFlash.java b/altoslib/AltosFlash.java index 25c76863..95ea73b5 100644 --- a/altoslib/AltosFlash.java +++ b/altoslib/AltosFlash.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_3; +package org.altusmetrum.altoslib_7; import java.io.*; @@ -345,9 +345,23 @@ public class AltosFlash extends AltosProgrammer { debug = new AltosDebug(link); input = new FileInputStream(file); image = new AltosHexfile(input); - if (debug != null && !debug.check_connection()) { + + boolean connection_ok = true; + + if (debug != null) { + try { + connection_ok = debug.check_connection(); + } catch (IOException ie) { + debug.close(); + throw ie; + } catch (InterruptedException ie) { + debug.close(); + throw ie; + } + } + if (!connection_ok) { debug.close(); throw new IOException("Debug port not connected"); } } -} \ No newline at end of file +}