From 29bb16397f14ed617ca3fbf48f2a7b726fd627d8 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Fri, 6 Sep 2013 16:49:36 -0700 Subject: [PATCH 1/1] 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 --- altoslib/AltosEepromTM.java | 13 ++++++------- 1 file 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; -- 2.30.2