X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=altoslib%2FAltosEepromTM.java;h=9a09f92693363f10ef162cc21ba274f353842ef6;hp=2bb9d974d9c639a17c506362db08d40de7700de4;hb=1085ec5d57e0ed5d132f2bbdac1a0b6a32c0ab4a;hpb=70e67925cff98984d49fbc3f60e880c91e6d5079 diff --git a/altoslib/AltosEepromTM.java b/altoslib/AltosEepromTM.java index 2bb9d974..9a09f926 100644 --- a/altoslib/AltosEepromTM.java +++ b/altoslib/AltosEepromTM.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_1; +package org.altusmetrum.altoslib_11; import java.io.*; import java.util.*; @@ -24,7 +25,6 @@ import java.text.*; public class AltosEepromTM extends AltosEeprom { public int a; public int b; - public boolean tick_valid; public static final int record_length = 8; @@ -131,10 +131,10 @@ public class AltosEepromTM extends AltosEeprom { public AltosEepromTM (AltosEepromChunk chunk, int start) throws ParseException { cmd = chunk.data(start); - tick_valid = true; + valid = true; - tick_valid = !chunk.erased(start, record_length); - if (tick_valid) { + valid = !chunk.erased(start, record_length); + if (valid) { if (AltosConvert.checksum(chunk.data, start, record_length) != 0) throw new ParseException(String.format("invalid checksum at 0x%x", chunk.address + start), 0); @@ -148,7 +148,7 @@ public class AltosEepromTM extends AltosEeprom { } public AltosEepromTM (String line) { - tick_valid = false; + valid = false; tick = 0; a = 0; b = 0; @@ -164,7 +164,7 @@ public class AltosEepromTM extends AltosEeprom { } else { cmd = tokens[0].codePointAt(0); tick = Integer.parseInt(tokens[1],16); - tick_valid = true; + valid = true; a = Integer.parseInt(tokens[2],16); b = Integer.parseInt(tokens[3],16); } @@ -178,7 +178,7 @@ public class AltosEepromTM extends AltosEeprom { } public AltosEepromTM(int in_cmd, int in_tick, int in_a, int in_b) { - tick_valid = true; + valid = true; cmd = in_cmd; tick = in_tick; a = in_a;