altosui: Stop downloading eeprom data on a block full of invalid data
authorKeith Packard <keithp@keithp.com>
Thu, 13 Sep 2012 04:32:25 +0000 (21:32 -0700)
committerKeith Packard <keithp@keithp.com>
Thu, 13 Sep 2012 04:35:34 +0000 (21:35 -0700)
When no valid records are found within an eeprom block, we assume that
no more data will be found within the entire storage area.

Signed-off-by: Keith Packard <keithp@keithp.com>
altosui/AltosEepromDownload.java

index b04890cdb35a5ebd28285cc80b565beb8511df1e..65cac7bd75f67084e0259f5c73be023f820f1974 100644 (file)
@@ -134,7 +134,8 @@ public class AltosEepromDownload implements Runnable {
                                }
                                if (r.cmd == Altos.AO_LOG_STATE && r.a == Altos.ao_flight_landed)
                                        done = true;
-                               any_valid = true;
+                               if (r.cmd != AltosLib.AO_LOG_INVALID)
+                                       any_valid = true;
                                Log(r);
                        } catch (ParseException pe) {
                                if (parse_exception == null)