diff options
author | Keith Packard <keithp@keithp.com> | 2013-04-22 17:20:51 -0500 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2013-04-22 17:20:51 -0500 |
commit | 33c3b2c57d0d4285b75d4dcf7ca67ad19da08c86 (patch) | |
tree | a9ff47afab29fe141dcd1da0ca276b367f911cb6 /altoslib/AltosEepromIterable.java | |
parent | 1a84db819a359be39be51c9105039ab28c9fc894 (diff) | |
parent | 90b0db1ae53182c94bf12d661446fc369d916366 (diff) |
Merge branch 'master' into stm-flash
Conflicts:
ao-tools/ao-stmload/ao-stmload.c
Diffstat (limited to 'altoslib/AltosEepromIterable.java')
-rw-r--r-- | altoslib/AltosEepromIterable.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/altoslib/AltosEepromIterable.java b/altoslib/AltosEepromIterable.java index bc698c80..7a8bbdea 100644 --- a/altoslib/AltosEepromIterable.java +++ b/altoslib/AltosEepromIterable.java @@ -131,24 +131,34 @@ public class AltosEepromIterable extends AltosRecordIterable { case AltosLib.AO_LOG_GPS_LAT: eeprom.seen |= AltosRecord.seen_gps_lat; int lat32 = record.a | (record.b << 16); + if (state.gps == null) + state.gps = new AltosGPS(); state.gps.lat = (double) lat32 / 1e7; break; case AltosLib.AO_LOG_GPS_LON: eeprom.seen |= AltosRecord.seen_gps_lon; int lon32 = record.a | (record.b << 16); + if (state.gps == null) + state.gps = new AltosGPS(); state.gps.lon = (double) lon32 / 1e7; break; case AltosLib.AO_LOG_GPS_ALT: + if (state.gps == null) + state.gps = new AltosGPS(); state.gps.alt = record.a; break; case AltosLib.AO_LOG_GPS_SAT: if (state.tick == eeprom.gps_tick) { int svid = record.a; int c_n0 = record.b >> 8; + if (state.gps == null) + state.gps = new AltosGPS(); state.gps.add_sat(svid, c_n0); } break; case AltosLib.AO_LOG_GPS_DATE: + if (state.gps == null) + state.gps = new AltosGPS(); state.gps.year = (record.a & 0xff) + 2000; state.gps.month = record.a >> 8; state.gps.day = record.b & 0xff; |