diff options
author | Keith Packard <keithp@keithp.com> | 2013-09-06 16:49:36 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2013-09-06 16:49:36 -0700 |
commit | 29bb16397f14ed617ca3fbf48f2a7b726fd627d8 (patch) | |
tree | 16290369f97f7557998b0f3ee63897ca00225fbd | |
parent | a299a5a9a1b89c7ebc00ebd33a789793a6835181 (diff) |
altoslib: Set 'valid' for valid TeleMetrum eeprom download
Had separate 'tick_valid' value, which wasn't useful as the supertype
didn't look there.
Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r-- | altoslib/AltosEepromTM.java | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/altoslib/AltosEepromTM.java b/altoslib/AltosEepromTM.java index a38c2dae..36803912 100644 --- a/altoslib/AltosEepromTM.java +++ b/altoslib/AltosEepromTM.java @@ -24,7 +24,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 +130,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 +147,7 @@ public class AltosEepromTM extends AltosEeprom { } public AltosEepromTM (String line) { - tick_valid = false; + valid = false; 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); - tick_valid = true; + valid = true; 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) { - tick_valid = true; + valid = true; cmd = in_cmd; tick = in_tick; a = in_a; |