X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=altoslib%2FAltosSelfFlash.java;h=537821729fc9a03adb4885d4d38337f2cede870b;hp=327a90bd645beef4f110228c026c8a9c6a62d58d;hb=10834eb60f7a44fee159d9e9ad5ffb2e013fe9cf;hpb=e26306c9350ef1d107d4257ef1c09d15165c9154 diff --git a/altoslib/AltosSelfFlash.java b/altoslib/AltosSelfFlash.java index 327a90bd..53782172 100644 --- a/altoslib/AltosSelfFlash.java +++ b/altoslib/AltosSelfFlash.java @@ -3,7 +3,8 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of @@ -15,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_2; +package org.altusmetrum.altoslib_12; import java.io.*; @@ -47,7 +48,7 @@ public class AltosSelfFlash extends AltosProgrammer { for (int offset = 0; offset < len; offset += 0x100) { link.printf("R %x\n", addr + offset); byte[] reply = link.get_binary_reply(5000, 0x100); - + if (reply == null) throw new IOException("Read device memory timeout"); for (b = 0; b < len; b++) @@ -55,10 +56,9 @@ public class AltosSelfFlash extends AltosProgrammer { } return data; } - + void write_memory(long addr, byte[] data, int start, int len) { int b; - System.out.printf ("write_memory %x %d\n", addr, len); link.printf("W %x\n", addr); link.flush_output(); for (b = 0; b < len; b++) @@ -68,7 +68,6 @@ public class AltosSelfFlash extends AltosProgrammer { } void reboot() { - System.out.printf("reboot\n"); link.printf("a\n"); link.flush_output(); } @@ -115,7 +114,6 @@ public class AltosSelfFlash extends AltosProgrammer { action(image.data.length - remain, image.data.length); } if (!aborted) { - System.out.printf ("done\n"); action("done", 100); } close(); @@ -144,7 +142,6 @@ public class AltosSelfFlash extends AltosProgrammer { } private AltosHexfile get_rom() throws InterruptedException { - System.out.printf("get rom\n"); try { int base = AltosRomconfig.fetch_base(image); int bounds = AltosRomconfig.fetch_bounds(image); @@ -153,7 +150,6 @@ public class AltosSelfFlash extends AltosProgrammer { hexfile.add_symbols(image); return hexfile; } catch (AltosNoSymbol none) { - System.out.printf("no symbol %s\n", none.getMessage()); return null; } catch (IOException ie) { return null; @@ -163,7 +159,6 @@ public class AltosSelfFlash extends AltosProgrammer { public boolean check_rom_config() throws InterruptedException { if (link == null) { - System.out.printf ("no link\n"); return true; } if (rom_config == null) { @@ -179,7 +174,6 @@ public class AltosSelfFlash extends AltosProgrammer { } public AltosRomconfig romconfig() throws InterruptedException { - System.out.printf("fetch romconfig\n"); if (!check_rom_config()) return null; return rom_config; @@ -192,6 +186,5 @@ public class AltosSelfFlash extends AltosProgrammer { this.listener = listener; input = new FileInputStream(file); image = new AltosHexfile(input); - System.out.printf ("AltosSelfFlash %x\n", image.address); } } \ No newline at end of file