X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=altosui%2FAltosFlash.java;h=bd0c8a5077057c5ea22da315312cdf99540abe75;hb=9fb15d397890c7e78bf3c1438f142f62bfc2bd35;hp=802adc8cd771aed965dfe6b91c1e1582d5632519;hpb=b8f05cdc0e9b4a96852eed9d38ff6d5950e2d2ed;p=fw%2Faltos diff --git a/altosui/AltosFlash.java b/altosui/AltosFlash.java index 802adc8c..bd0c8a50 100644 --- a/altosui/AltosFlash.java +++ b/altosui/AltosFlash.java @@ -27,8 +27,9 @@ import java.util.*; import java.text.*; import java.util.prefs.*; import java.util.concurrent.LinkedBlockingQueue; +import org.altusmetrum.AltosLib.*; -public class AltosFlash implements Runnable { +public class AltosFlash { File file; FileInputStream input; AltosHexfile image; @@ -252,9 +253,7 @@ public class AltosFlash implements Runnable { throw new IOException("Failed to execute program on target"); } - Thread thread; - - public void run() { + public void flash() { try { if (!check_rom_config()) throw new IOException("Invalid rom config settings"); @@ -333,15 +332,14 @@ public class AltosFlash implements Runnable { } } - public void flash() { - thread = new Thread(this); - thread.start(); + public void close() { + if (debug != null) + debug.close(); } synchronized public void abort() { aborted = true; - if (debug != null) - debug.close(); + close(); } public void addActionListener(ActionListener l) {