From 8d08223e8ae6f0c1431734c85a517b20e3287ac3 Mon Sep 17 00:00:00 2001 From: Laurent Lalanne Date: Sat, 15 Nov 2014 22:39:17 +0100 Subject: [PATCH] OP-1601 Don't use new PVT messages with CC/CC3D --- flight/modules/GPS/UBX.c | 10 ++++------ flight/modules/GPS/inc/UBX.h | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/flight/modules/GPS/UBX.c b/flight/modules/GPS/UBX.c index ff4c1ea6a..25fc4d943 100644 --- a/flight/modules/GPS/UBX.c +++ b/flight/modules/GPS/UBX.c @@ -58,12 +58,12 @@ typedef struct { // parsing functions, roughly ordered by reception rate (higher rate messages on top) -static void parse_ubx_nav_pvt(struct UBXPacket *ubx, GPSPositionSensorData *GpsPosition); static void parse_ubx_nav_posllh(struct UBXPacket *ubx, GPSPositionSensorData *GpsPosition); static void parse_ubx_nav_velned(struct UBXPacket *ubx, GPSPositionSensorData *GpsPosition); static void parse_ubx_nav_sol(struct UBXPacket *ubx, GPSPositionSensorData *GpsPosition); static void parse_ubx_nav_dop(struct UBXPacket *ubx, GPSPositionSensorData *GpsPosition); #ifndef PIOS_GPS_MINIMAL +static void parse_ubx_nav_pvt(struct UBXPacket *ubx, GPSPositionSensorData *GpsPosition); static void parse_ubx_nav_timeutc(struct UBXPacket *ubx, GPSPositionSensorData *GpsPosition); static void parse_ubx_nav_svinfo(struct UBXPacket *ubx, GPSPositionSensorData *GpsPosition); @@ -81,8 +81,8 @@ const ubx_message_handler ubx_handler_table[] = { { .msgClass = UBX_CLASS_NAV, .msgID = UBX_ID_NAV_VELNED, .handler = &parse_ubx_nav_velned }, { .msgClass = UBX_CLASS_NAV, .msgID = UBX_ID_NAV_SOL, .handler = &parse_ubx_nav_sol }, { .msgClass = UBX_CLASS_NAV, .msgID = UBX_ID_NAV_DOP, .handler = &parse_ubx_nav_dop }, - { .msgClass = UBX_CLASS_NAV, .msgID = UBX_ID_NAV_PVT, .handler = &parse_ubx_nav_pvt }, #ifndef PIOS_GPS_MINIMAL + { .msgClass = UBX_CLASS_NAV, .msgID = UBX_ID_NAV_PVT, .handler = &parse_ubx_nav_pvt }, { .msgClass = UBX_CLASS_OP_CUST, .msgID = UBX_ID_OP_MAG, .handler = &parse_ubx_op_mag }, { .msgClass = UBX_CLASS_NAV, .msgID = UBX_ID_NAV_SVINFO, .handler = &parse_ubx_nav_svinfo }, { .msgClass = UBX_CLASS_NAV, .msgID = UBX_ID_NAV_TIMEUTC, .handler = &parse_ubx_nav_timeutc }, @@ -336,7 +336,7 @@ static void parse_ubx_nav_velned(struct UBXPacket *ubx, GPSPositionSensorData *G } } } - +#if !defined(PIOS_GPS_MINIMAL) static void parse_ubx_nav_pvt(struct UBXPacket *ubx, GPSPositionSensorData *GpsPosition) { lastPvtTime = PIOS_DELAY_GetuS(); @@ -364,7 +364,7 @@ static void parse_ubx_nav_pvt(struct UBXPacket *ubx, GPSPositionSensorData *GpsP } else { GpsPosition->Status = GPSPOSITIONSENSOR_STATUS_NOFIX; } -#if !defined(PIOS_GPS_MINIMAL) + if (pvt->valid & PVT_VALID_VALIDTIME) { // Time is valid, set GpsTime GPSTimeData GpsTime; @@ -378,10 +378,8 @@ static void parse_ubx_nav_pvt(struct UBXPacket *ubx, GPSPositionSensorData *GpsP GPSTimeSet(&GpsTime); } -#endif } -#if !defined(PIOS_GPS_MINIMAL) static void parse_ubx_nav_timeutc(struct UBXPacket *ubx, __attribute__((unused)) GPSPositionSensorData *GpsPosition) { if (usePvt) { diff --git a/flight/modules/GPS/inc/UBX.h b/flight/modules/GPS/inc/UBX.h index db68a2562..5a5bd1d7d 100644 --- a/flight/modules/GPS/inc/UBX.h +++ b/flight/modules/GPS/inc/UBX.h @@ -369,8 +369,8 @@ typedef union { struct UBX_NAV_DOP nav_dop; struct UBX_NAV_SOL nav_sol; struct UBX_NAV_VELNED nav_velned; - struct UBX_NAV_PVT nav_pvt; #if !defined(PIOS_GPS_MINIMAL) + struct UBX_NAV_PVT nav_pvt; struct UBX_NAV_TIMEUTC nav_timeutc; struct UBX_NAV_SVINFO nav_svinfo; // Ack Class