Switch from GPLv2 to GPLv2+
[fw/altos] / src / drivers / ao_gps_ublox.c
index 077698a90d514a24672b3d990d867118a1c67a9c..22af413a0098008f2ed7dd1e1fa44834ef0c54f9 100644 (file)
@@ -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
- * 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
@@ -728,7 +729,7 @@ ao_gps(void) __reentrant
                                if (nav_timeutc.valid & (1 << NAV_TIMEUTC_VALID_UTC))
                                        ao_gps_data.flags |= AO_GPS_DATE_VALID;
 
-                               ao_gps_data.altitude = nav_posllh.alt_msl / 1000;
+                               AO_TELEMETRY_LOCATION_SET_ALTITUDE(&ao_gps_data, nav_posllh.alt_msl / 1000);
                                ao_gps_data.latitude = nav_posllh.lat;
                                ao_gps_data.longitude = nav_posllh.lon;
 
@@ -740,11 +741,11 @@ ao_gps(void) __reentrant
                                ao_gps_data.minute = nav_timeutc.min;
                                ao_gps_data.second = nav_timeutc.sec;
 
-                               ao_gps_data.pdop = nav_dop.pdop;
-                               ao_gps_data.hdop = nav_dop.hdop;
-                               ao_gps_data.vdop = nav_dop.vdop;
-
-                               /* mode is not set */
+                               /* we report dop scaled by 10, but ublox provides dop scaled by 100
+                                */
+                               ao_gps_data.pdop = nav_dop.pdop / 10;
+                               ao_gps_data.hdop = nav_dop.hdop / 10;
+                               ao_gps_data.vdop = nav_dop.vdop / 10;
 
                                ao_gps_data.ground_speed = nav_velned.g_speed;
                                ao_gps_data.climb_rate = -nav_velned.vel_d;