X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=ao-tools%2Faltosui%2FAltosDebug.java;h=9aa35d3f2f834813d7cfdd51a5dbf2a631b750ee;hp=ca2e5a9046625465130c0f4dd1ec55f9c10cba48;hb=939be6793238a275b7682ecc376fed14379cf044;hpb=c443f43f8dee6e0fcbcecf9d09e948fd928b7af4 diff --git a/ao-tools/altosui/AltosDebug.java b/ao-tools/altosui/AltosDebug.java index ca2e5a90..9aa35d3f 100644 --- a/ao-tools/altosui/AltosDebug.java +++ b/ao-tools/altosui/AltosDebug.java @@ -19,11 +19,10 @@ package altosui; import java.lang.*; import java.io.*; -import java.util.concurrent.LinkedBlockingQueue; -import java.util.LinkedList; -import java.util.Iterator; -import altosui.AltosSerial; -import altosui.AltosRomconfig; +import java.util.concurrent.*; +import java.util.*; + +import libaltosJNI.*; public class AltosDebug extends AltosSerial { @@ -62,8 +61,8 @@ public class AltosDebug extends AltosSerial { void ensure_debug_mode() { if (!debug_mode) { - printf("m 0\nD\n"); - flush_reply(); + printf("D\n"); + flush_input(); debug_mode = true; } } @@ -103,7 +102,7 @@ public class AltosDebug extends AltosSerial { throws IOException, InterruptedException { byte[] data = new byte[length]; - flush_reply(); + flush_input(); ensure_debug_mode(); printf("I %x %x\n", length, address); int i = 0; @@ -155,7 +154,7 @@ public class AltosDebug extends AltosSerial { public byte[] read_bytes(int length) throws IOException, InterruptedException { - flush_reply(); + flush_input(); ensure_debug_mode(); printf("G %x\n", length); int i = 0; @@ -261,4 +260,8 @@ public class AltosDebug extends AltosSerial { public void reset() { printf ("R\n"); } + + public AltosDebug (altos_device in_device) throws FileNotFoundException, AltosSerialInUseException { + super(in_device); + } } \ No newline at end of file