altoslib: Set 'valid' for valid TeleMetrum eeprom download
authorKeith Packard <keithp@keithp.com>
Fri, 6 Sep 2013 23:49:36 +0000 (16:49 -0700)
committerKeith Packard <keithp@keithp.com>
Fri, 6 Sep 2013 23:49:36 +0000 (16:49 -0700)
Had separate 'tick_valid' value, which wasn't useful as the supertype
didn't look there.

Signed-off-by: Keith Packard <keithp@keithp.com>
altoslib/AltosEepromTM.java

index a38c2dae628a914f258117c2a6feef9b71348315..36803912b2c7a5ddc0410ed75ac825a7fb86a6fe 100644 (file)
@@ -24,7 +24,6 @@ import java.text.*;
 public class AltosEepromTM extends AltosEeprom {
        public int      a;
        public int      b;
 public class AltosEepromTM extends AltosEeprom {
        public int      a;
        public int      b;
-       public boolean  tick_valid;
 
        public static final int record_length = 8;
 
 
        public static final int record_length = 8;
 
@@ -131,10 +130,10 @@ public class AltosEepromTM extends AltosEeprom {
        public AltosEepromTM (AltosEepromChunk chunk, int start) throws ParseException {
 
                cmd = chunk.data(start);
        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);
                        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 +147,7 @@ public class AltosEepromTM extends AltosEeprom {
        }
 
        public AltosEepromTM (String line) {
        }
 
        public AltosEepromTM (String line) {
-               tick_valid = false;
+               valid = false;
                tick = 0;
                a = 0;
                b = 0;
                tick = 0;
                a = 0;
                b = 0;
@@ -164,7 +163,7 @@ public class AltosEepromTM extends AltosEeprom {
                                        } else {
                                                cmd = tokens[0].codePointAt(0);
                                                tick = Integer.parseInt(tokens[1],16);
                                        } 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);
                                        }
                                                a = Integer.parseInt(tokens[2],16);
                                                b = Integer.parseInt(tokens[3],16);
                                        }
@@ -178,7 +177,7 @@ public class AltosEepromTM extends AltosEeprom {
        }
 
        public AltosEepromTM(int in_cmd, int in_tick, int in_a, int in_b) {
        }
 
        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;
                cmd = in_cmd;
                tick = in_tick;
                a = in_a;