diff options
| author | Keith Packard <keithp@keithp.com> | 2010-08-23 14:32:58 -0700 |
|---|---|---|
| committer | Keith Packard <keithp@keithp.com> | 2010-08-23 14:32:58 -0700 |
| commit | ebeb13688a9a5442c838641ede6ba0dc92c9a1a4 (patch) | |
| tree | 498e5b186a9c5dbdbc042b631d6f2c48a6fc2e55 /ao-tools/altosui/AltosHexfile.java | |
| parent | 7f8d7978606abe544b1b9b6065c5480ed813b8ec (diff) | |
altosui: Add debug dongle API, split flash UI out
Create an API to talk through the debug port on another AltOS
device. Split the flash UI out from the flash implementation so that a
command line flash utility can be written.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'ao-tools/altosui/AltosHexfile.java')
| -rw-r--r-- | ao-tools/altosui/AltosHexfile.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ao-tools/altosui/AltosHexfile.java b/ao-tools/altosui/AltosHexfile.java index c7078877..360e24ad 100644 --- a/ao-tools/altosui/AltosHexfile.java +++ b/ao-tools/altosui/AltosHexfile.java @@ -214,6 +214,10 @@ public class AltosHexfile { public int address; public byte[] data; + public byte get_byte(int a) { + return data[a - address]; + } + public AltosHexfile(FileInputStream file) throws IOException { HexFileInputStream input = new HexFileInputStream(file); LinkedList<HexRecord> record_list = new LinkedList<HexRecord>(); @@ -244,5 +248,7 @@ public class AltosHexfile { data[records[i].address - base + j] = records[i].data[j]; } } + for (int i = 0xa0; i < 0xaa; i++) + System.out.printf ("%04x: %02x\n", i, get_byte(i)); } }
\ No newline at end of file |
