X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=altoslib%2FAltosFlash.java;h=e4b980b07cc1dcbdc97a906ec639e80fb13a5b77;hb=0fd370af8bc8842000415c4d182d84b4bf6f90fa;hp=0906f2ef0ffe74c40be2190241f4619d9f5055c2;hpb=88fa5fa6acbdd66d1338ca73cbbac219d62b5136;p=fw%2Faltos diff --git a/altoslib/AltosFlash.java b/altoslib/AltosFlash.java index 0906f2ef..e4b980b0 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_2; +package org.altusmetrum.altoslib_8; import java.io.*; @@ -318,7 +318,7 @@ public class AltosFlash extends AltosProgrammer { close(); } - public boolean check_rom_config() { + public boolean check_rom_config() throws InterruptedException { if (debug == null) return true; if (rom_config == null) @@ -330,7 +330,7 @@ public class AltosFlash extends AltosProgrammer { rom_config = romconfig; } - public AltosRomconfig romconfig() { + public AltosRomconfig romconfig() throws InterruptedException { if (!check_rom_config()) return null; return rom_config; @@ -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 +}