projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altos/arm: Align data so that gcc 5.4 doesn't do byte-accesses. Add -Wcast-align
[fw/altos]
/
altoslib
/
AltosEepromGPS.java
diff --git
a/altoslib/AltosEepromGPS.java
b/altoslib/AltosEepromGPS.java
index 46a2173de6063c08211789598df215241c1178f2..e76b36dde0f0492f004e4633b394a02c030fb8bf 100644
(file)
--- a/
altoslib/AltosEepromGPS.java
+++ b/
altoslib/AltosEepromGPS.java
@@
-3,7
+3,8
@@
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
@@
-15,7
+16,7
@@
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-package org.altusmetrum.altoslib_
5
;
+package org.altusmetrum.altoslib_
11
;
import java.io.*;
import java.util.*;
import java.io.*;
import java.util.*;
@@
-37,7
+38,7
@@
public class AltosEepromGPS extends AltosEeprom {
/* AO_LOG_GPS_TIME elements */
public int latitude() { return data32(0); }
public int longitude() { return data32(4); }
/* AO_LOG_GPS_TIME elements */
public int latitude() { return data32(0); }
public int longitude() { return data32(4); }
- public int altitude() { return data16(8); }
+ public int altitude
_low
() { return data16(8); }
public int hour() { return data8(10); }
public int minute() { return data8(11); }
public int second() { return data8(12); }
public int hour() { return data8(10); }
public int minute() { return data8(11); }
public int second() { return data8(12); }
@@
-52,6
+53,7
@@
public class AltosEepromGPS extends AltosEeprom {
public int hdop() { return data8(23); }
public int vdop() { return data8(24); }
public int mode() { return data8(25); }
public int hdop() { return data8(23); }
public int vdop() { return data8(24); }
public int mode() { return data8(25); }
+ public int altitude_high() { return data16(26); }
public boolean has_seconds() { return cmd == AltosLib.AO_LOG_GPS_TIME; }
public boolean has_seconds() { return cmd == AltosLib.AO_LOG_GPS_TIME; }
@@
-90,8
+92,10
@@
public class AltosEepromGPS extends AltosEeprom {
switch (cmd) {
case AltosLib.AO_LOG_FLIGHT:
switch (cmd) {
case AltosLib.AO_LOG_FLIGHT:
- state.set_boost_tick(tick);
- state.set_flight(flight());
+ if (state.flight == AltosLib.MISSING) {
+ state.set_boost_tick(tick);
+ state.set_flight(flight());
+ }
/* no place to log start lat/lon yet */
break;
case AltosLib.AO_LOG_GPS_TIME:
/* no place to log start lat/lon yet */
break;
case AltosLib.AO_LOG_GPS_TIME:
@@
-99,7
+103,10
@@
public class AltosEepromGPS extends AltosEeprom {
gps = state.make_temp_gps(false);
gps.lat = latitude() / 1e7;
gps.lon = longitude() / 1e7;
gps = state.make_temp_gps(false);
gps.lat = latitude() / 1e7;
gps.lon = longitude() / 1e7;
- gps.alt = altitude();
+ if (state.altitude_32())
+ gps.alt = (altitude_low() & 0xffff) | (altitude_high() << 16);
+ else
+ gps.alt = altitude_low();
gps.hour = hour();
gps.minute = minute();
gps.hour = hour();
gps.minute = minute();