X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=altoslib%2FAltosEepromTM.java;h=9a09f92693363f10ef162cc21ba274f353842ef6;hb=6804ead7f7e54ff34b257e10e381dc52d5a61b06;hp=a38c2dae628a914f258117c2a6feef9b71348315;hpb=5b976a6651f4eb05d30afc08b9e1f27c7e52ae00;p=fw%2Faltos diff --git a/altoslib/AltosEepromTM.java b/altoslib/AltosEepromTM.java index a38c2dae..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_2; +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;