summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2011-02-19 01:04:19 -0800
committerKeith Packard <keithp@keithp.com>2011-03-19 16:50:38 -0700
commit762657983fcf526cdf99b59a541e3f3cbb0701dc (patch)
treee15452d50bcbde8deb55a2452dda04f7e02cee23
parent62fc5b2d33d4f64afff1f965ac52598ba9373bc0 (diff)
altosui: Always read whole eeprom block, even at end of flight
Instead of stopping early, continue reading the whole eeprom block so that the extra serial data doesn't end up confusing the next user of the serial line, which may well be reading the next flight. Signed-off-by: Keith Packard <keithp@keithp.com> (cherry picked from commit 629a7637871b24fe6d1204aaa7185d84933d4639)
-rw-r--r--altosui/AltosEepromBlock.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/altosui/AltosEepromBlock.java b/altosui/AltosEepromBlock.java
index f223f3fb..11438df8 100644
--- a/altosui/AltosEepromBlock.java
+++ b/altosui/AltosEepromBlock.java
@@ -56,7 +56,7 @@ public class AltosEepromBlock extends ArrayList<AltosEepromRecord> {
has_lon = false;
has_time = false;
serial_line.printf("e %x\n", block);
- for (addr = 0; !done && addr < 0x100;) {
+ for (addr = 0; addr < 0x100;) {
try {
AltosEepromRecord r = new AltosEepromRecord(serial_line, block * 256 + addr);
@@ -93,10 +93,15 @@ public class AltosEepromBlock extends ArrayList<AltosEepromRecord> {
lon = (double) (r.a | (r.b << 16)) / 1e7;
has_lon = true;
}
+ if (!done)
+ add(addr / 8, r);
if (r.cmd == Altos.AO_LOG_STATE && r.a == Altos.ao_flight_landed)
done = true;
- add(addr / 8, r);
} catch (ParseException pe) {
+ AltosEepromRecord r = new AltosEepromRecord(Altos.AO_LOG_INVALID,
+ 0, 0, 0);
+ if (!done)
+ add(addr/8, r);
}
addr += 8;
}