From 831f8265e71806f417dd3b4ef1f42f945bf10369 Mon Sep 17 00:00:00 2001 From: Laurent Lalanne Date: Sun, 3 Jul 2016 03:51:44 +0200 Subject: [PATCH 1/3] LP-354 Add Ublox AssistNowAutonomous setting, file heading typos --- flight/modules/GPS/DJI.c | 2 +- flight/modules/GPS/GPS.c | 5 +- flight/modules/GPS/NMEA.c | 4 +- flight/modules/GPS/UBX.c | 4 +- flight/modules/GPS/inc/DJI.h | 4 +- flight/modules/GPS/inc/GPS.h | 2 +- flight/modules/GPS/inc/NMEA.h | 4 +- flight/modules/GPS/inc/UBX.h | 65 ++++++++++++++++------ flight/modules/GPS/inc/ubx_autoconfig.h | 20 ++++--- flight/modules/GPS/ubx_autoconfig.c | 23 +++++++- shared/uavobjectdefinition/gpssettings.xml | 2 + 11 files changed, 96 insertions(+), 39 deletions(-) diff --git a/flight/modules/GPS/DJI.c b/flight/modules/GPS/DJI.c index a02e8301c..a178e1cf2 100644 --- a/flight/modules/GPS/DJI.c +++ b/flight/modules/GPS/DJI.c @@ -2,7 +2,7 @@ ****************************************************************************** * @addtogroup OpenPilotModules OpenPilot Modules * @{ - * @addtogroup GSPModule GPS Module + * @addtogroup GPSModule GPS Module * @brief Process GPS information (DJI-Naza binary format) * @{ * diff --git a/flight/modules/GPS/GPS.c b/flight/modules/GPS/GPS.c index 04a38f8f4..305fb7148 100644 --- a/flight/modules/GPS/GPS.c +++ b/flight/modules/GPS/GPS.c @@ -2,14 +2,14 @@ ****************************************************************************** * @addtogroup OpenPilotModules OpenPilot Modules * @{ - * @addtogroup GSPModule GPS Module + * @addtogroup GPSModule GPS Module * @brief Process GPS information * @{ * * @file GPS.c * @author The LibrePilot Project, http://www.librepilot.org Copyright (C) 2016. * The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. - * @brief GPS module, handles GPS and NMEA stream + * @brief GPS module, handles GPS and various streams * @see The GNU Public License (GPL) Version 3 * *****************************************************************************/ @@ -669,6 +669,7 @@ void updateGpsSettings(__attribute__((unused)) UAVObjEvent *ev) // because ubx auto config never gets called // setting it up completely means that if we switch from the other protocol to UBX or disabled to enabled, that it will start normally newconfig.UbxAutoConfig = gpsSettings.UbxAutoConfig; + newconfig.AssistNowAutonomous = gpsSettings.UbxAssistNowAutonomous; newconfig.navRate = gpsSettings.UbxRate; newconfig.dynamicModel = gpsSettings.UbxDynamicModel == GPSSETTINGS_UBXDYNAMICMODEL_PORTABLE ? UBX_DYNMODEL_PORTABLE : gpsSettings.UbxDynamicModel == GPSSETTINGS_UBXDYNAMICMODEL_STATIONARY ? UBX_DYNMODEL_STATIONARY : diff --git a/flight/modules/GPS/NMEA.c b/flight/modules/GPS/NMEA.c index 825164bf3..1173bdae2 100644 --- a/flight/modules/GPS/NMEA.c +++ b/flight/modules/GPS/NMEA.c @@ -2,8 +2,8 @@ ****************************************************************************** * @addtogroup OpenPilotModules OpenPilot Modules * @{ - * @addtogroup GSPModule GPS Module - * @brief Process GPS information + * @addtogroup GPSModule GPS Module + * @brief Process GPS information (NMEA format) * @{ * * @file NMEA.c diff --git a/flight/modules/GPS/UBX.c b/flight/modules/GPS/UBX.c index 368ca6b6c..19ad46127 100644 --- a/flight/modules/GPS/UBX.c +++ b/flight/modules/GPS/UBX.c @@ -2,14 +2,14 @@ ****************************************************************************** * @addtogroup OpenPilotModules OpenPilot Modules * @{ - * @addtogroup GSPModule GPS Module + * @addtogroup GPSModule GPS Module * @brief Process GPS information (UBX binary format) * @{ * * @file UBX.c * @author The LibrePilot Project, http://www.librepilot.org Copyright (C) 2015-2016. * The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012. - * @brief GPS module, handles GPS and NMEA stream + * @brief GPS module, handles GPS and UBX stream * @see The GNU Public License (GPL) Version 3 * *****************************************************************************/ diff --git a/flight/modules/GPS/inc/DJI.h b/flight/modules/GPS/inc/DJI.h index 1cf58c82b..47ad02472 100644 --- a/flight/modules/GPS/inc/DJI.h +++ b/flight/modules/GPS/inc/DJI.h @@ -2,8 +2,8 @@ ****************************************************************************** * @addtogroup OpenPilotModules OpenPilot Modules * @{ - * @addtogroup GSPModule GPS Module - * @brief Process GPS information + * @addtogroup GPSModule GPS Module + * @brief Process GPS information (DJI-Naza binary format) * @{ * * @file DJI.h diff --git a/flight/modules/GPS/inc/GPS.h b/flight/modules/GPS/inc/GPS.h index 4722e1100..764f4597e 100644 --- a/flight/modules/GPS/inc/GPS.h +++ b/flight/modules/GPS/inc/GPS.h @@ -2,7 +2,7 @@ ****************************************************************************** * @addtogroup OpenPilotModules OpenPilot Modules * @{ - * @addtogroup GSPModule GPS Module + * @addtogroup GPSModule GPS Module * @brief Process GPS information * @{ * diff --git a/flight/modules/GPS/inc/NMEA.h b/flight/modules/GPS/inc/NMEA.h index c337abb07..720e21290 100644 --- a/flight/modules/GPS/inc/NMEA.h +++ b/flight/modules/GPS/inc/NMEA.h @@ -2,8 +2,8 @@ ****************************************************************************** * @addtogroup OpenPilotModules OpenPilot Modules * @{ - * @addtogroup GSPModule GPS Module - * @brief Process GPS information + * @addtogroup GPSModule GPS Module + * @brief Process GPS information (NMEA format) * @{ * * @file NMEA.h diff --git a/flight/modules/GPS/inc/UBX.h b/flight/modules/GPS/inc/UBX.h index b7d92b3fa..b85f173f4 100644 --- a/flight/modules/GPS/inc/UBX.h +++ b/flight/modules/GPS/inc/UBX.h @@ -2,14 +2,14 @@ ****************************************************************************** * @addtogroup OpenPilotModules OpenPilot Modules * @{ - * @addtogroup GSPModule GPS Module - * @brief Process GPS information + * @addtogroup GPSModule GPS Module + * @brief Process GPS information (UBX binary format) * @{ * * @file UBX.h * @author The LibrePilot Project, http://www.librepilot.org Copyright (C) 2015-2016. * The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. - * @brief GPS module, handles GPS and NMEA stream + * @brief GPS module, handles GPS and UBX stream * @see The GNU Public License (GPL) Version 3 * *****************************************************************************/ @@ -43,6 +43,8 @@ #define UBX_HW_VERSION_8 80000 #define UBX_HW_VERSION_7 70000 +#define UBX_HW_VERSION_5 50000 + #define UBX_SYNC1 0xb5 // UBX protocol synchronization characters #define UBX_SYNC2 0x62 @@ -98,13 +100,14 @@ typedef enum { } ubx_class_mon_id; typedef enum { - UBX_ID_CFG_NAV5 = 0x24, - UBX_ID_CFG_RATE = 0x08, - UBX_ID_CFG_MSG = 0x01, - UBX_ID_CFG_CFG = 0x09, - UBX_ID_CFG_SBAS = 0x16, - UBX_ID_CFG_GNSS = 0x3E, - UBX_ID_CFG_PRT = 0x00 + UBX_ID_CFG_NAV5 = 0x24, + UBX_ID_CFG_NAVX5 = 0x23, + UBX_ID_CFG_RATE = 0x08, + UBX_ID_CFG_MSG = 0x01, + UBX_ID_CFG_CFG = 0x09, + UBX_ID_CFG_SBAS = 0x16, + UBX_ID_CFG_GNSS = 0x3E, + UBX_ID_CFG_PRT = 0x00 } ubx_class_cfg_id; typedef enum { @@ -523,6 +526,33 @@ struct UBX_CFG_NAV5 { uint32_t reserved4; } __attribute__((packed)); +struct UBX_CFG_NAVX5 { + uint16_t version; + uint16_t mask1; + uint32_t reserved0; + uint8_t reserved1; + uint8_t reserved2; + uint8_t minSVs; + uint8_t maxSVs; + uint8_t minCN0; + uint8_t reserved5; + uint8_t iniFix3D; + uint8_t reserved6; + uint8_t reserved7; + uint8_t reserved8; + uint16_t wknRollover; + uint32_t reserved9; + uint8_t reserved10; + uint8_t reserved11; + uint8_t usePPP; + uint8_t useAOP; + uint8_t reserved12; + uint8_t reserved13; + uint16_t aopOrbMaxErr; + uint32_t reserved3; + uint32_t reserved4; +} __attribute__((packed)); + // MON message Class #define UBX_MON_MAX_EXT 5 struct UBX_MON_VER { @@ -599,13 +629,14 @@ union UBXSENTPACKET { struct { struct UBXSENTHEADER header; union { - struct UBX_CFG_CFG cfg_cfg; - struct UBX_CFG_MSG cfg_msg; - struct UBX_CFG_NAV5 cfg_nav5; - struct UBX_CFG_PRT cfg_prt; - struct UBX_CFG_RATE cfg_rate; - struct UBX_CFG_SBAS cfg_sbas; - struct UBX_CFG_GNSS cfg_gnss; + struct UBX_CFG_CFG cfg_cfg; + struct UBX_CFG_MSG cfg_msg; + struct UBX_CFG_NAV5 cfg_nav5; + struct UBX_CFG_NAVX5 cfg_navx5; + struct UBX_CFG_PRT cfg_prt; + struct UBX_CFG_RATE cfg_rate; + struct UBX_CFG_SBAS cfg_sbas; + struct UBX_CFG_GNSS cfg_gnss; } payload; uint8_t resvd[2]; // added space for checksum bytes } message; diff --git a/flight/modules/GPS/inc/ubx_autoconfig.h b/flight/modules/GPS/inc/ubx_autoconfig.h index f24bc48a7..8578f1d6b 100644 --- a/flight/modules/GPS/inc/ubx_autoconfig.h +++ b/flight/modules/GPS/inc/ubx_autoconfig.h @@ -1,13 +1,17 @@ /** ****************************************************************************** + * @addtogroup OpenPilotModules OpenPilot Modules + * @{ + * @addtogroup GPSModule GPS Module + * @brief Support code for UBX AutoConfig + * @{ + * + * @file ubx_autoconfig.h + * @author The LibrePilot Project, http://www.librepilot.org Copyright (C) 2016. + * The OpenPilot Team, http://www.openpilot.org Copyright (C) 2014. + * @brief Support code for UBX AutoConfig + * @see The GNU Public License (GPL) Version 3 * - * @file %FILENAME% - * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2014. - * @addtogroup [Group] - * @{ - * @addtogroup %CLASS% - * @{ - * @brief [Brief] *****************************************************************************/ /* * This program is free software; you can redistribute it and/or modify @@ -85,6 +89,7 @@ typedef enum { #define UBX_ typedef struct { GPSSettingsUbxAutoConfigOptions UbxAutoConfig; + GPSSettingsUbxAssistNowAutonomousOptions AssistNowAutonomous; bool SBASRanging; bool SBASCorrection; bool SBASIntegrity; @@ -102,6 +107,7 @@ typedef struct { // Sent messages for configuration support typedef struct UBX_CFG_CFG ubx_cfg_cfg_t; typedef struct UBX_CFG_NAV5 ubx_cfg_nav5_t; +typedef struct UBX_CFG_NAVX5 ubx_cfg_navx5_t; typedef struct UBX_CFG_RATE ubx_cfg_rate_t; typedef struct UBX_CFG_MSG ubx_cfg_msg_t; typedef struct UBX_CFG_PRT ubx_cfg_prt_t; diff --git a/flight/modules/GPS/ubx_autoconfig.c b/flight/modules/GPS/ubx_autoconfig.c index 14db54527..795c4afc6 100644 --- a/flight/modules/GPS/ubx_autoconfig.c +++ b/flight/modules/GPS/ubx_autoconfig.c @@ -2,7 +2,7 @@ ****************************************************************************** * @addtogroup OpenPilotModules OpenPilot Modules * @{ - * @addtogroup GSPModule GPS Module + * @addtogroup GPSModule GPS Module * @brief Support code for UBX AutoConfig * @{ * @@ -317,6 +317,15 @@ static void config_nav(uint16_t *bytes_to_send) *bytes_to_send = prepare_packet((UBXSentPacket_t *)&status->working_packet, UBX_CLASS_CFG, UBX_ID_CFG_NAV5, sizeof(ubx_cfg_nav5_t)); } +static void config_navx(uint16_t *bytes_to_send) +{ + memset((uint8_t *)status->working_packet.buffer, 0, sizeof(UBXSentHeader_t) + sizeof(ubx_cfg_navx5_t)); + status->working_packet.message.payload.cfg_navx5.useAOP = status->currentSettings.AssistNowAutonomous; + status->working_packet.message.payload.cfg_navx5.mask1 = 0x4000; // aop configuration + + *bytes_to_send = prepare_packet((UBXSentPacket_t *)&status->working_packet, UBX_CLASS_CFG, UBX_ID_CFG_NAVX5, sizeof(ubx_cfg_navx5_t)); +} + static void config_sbas(uint16_t *bytes_to_send) { @@ -409,7 +418,6 @@ static void config_save(uint16_t *bytes_to_send) *bytes_to_send = prepare_packet((UBXSentPacket_t *)&status->working_packet, UBX_CLASS_CFG, UBX_ID_CFG_CFG, sizeof(ubx_cfg_cfg_t)); } - static void configure(uint16_t *bytes_to_send) { switch (status->lastConfigSent) { @@ -423,6 +431,15 @@ static void configure(uint16_t *bytes_to_send) break; case LAST_CONFIG_SENT_START + 2: + if (ubxHwVersion > UBX_HW_VERSION_5) { + config_navx(bytes_to_send); + break; + } else { + // Skip and fall through to next step + status->lastConfigSent++; + } + + case LAST_CONFIG_SENT_START + 3: if (status->currentSettings.enableGLONASS || status->currentSettings.enableGPS) { config_gnss(bytes_to_send); break; @@ -432,7 +449,7 @@ static void configure(uint16_t *bytes_to_send) } // in the else case we must fall through because we must send something each time because successful send is tested externally - case LAST_CONFIG_SENT_START + 3: + case LAST_CONFIG_SENT_START + 4: config_sbas(bytes_to_send); break; diff --git a/shared/uavobjectdefinition/gpssettings.xml b/shared/uavobjectdefinition/gpssettings.xml index ac20c56fd..0e0be02c9 100644 --- a/shared/uavobjectdefinition/gpssettings.xml +++ b/shared/uavobjectdefinition/gpssettings.xml @@ -19,6 +19,8 @@ + From 1a6b0a4d70d736f1ff11d78a459aa743077a8c95 Mon Sep 17 00:00:00 2001 From: Laurent Lalanne Date: Sun, 3 Jul 2016 18:44:45 +0200 Subject: [PATCH 2/3] LP-354 Define Nav5 and Navx5 constants in UBX.h --- flight/modules/GPS/inc/UBX.h | 22 +++++++++++++++++++++- flight/modules/GPS/ubx_autoconfig.c | 6 +++--- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/flight/modules/GPS/inc/UBX.h b/flight/modules/GPS/inc/UBX.h index b85f173f4..e468a7b32 100644 --- a/flight/modules/GPS/inc/UBX.h +++ b/flight/modules/GPS/inc/UBX.h @@ -42,7 +42,7 @@ #define UBX_HW_VERSION_8 80000 #define UBX_HW_VERSION_7 70000 - +#define UBX_HW_VERSION_6 60000 #define UBX_HW_VERSION_5 50000 #define UBX_SYNC1 0xb5 // UBX protocol synchronization characters @@ -505,6 +505,19 @@ struct UBX_CFG_GNSS { struct UBX_CFG_GNSS_CFGBLOCK cfgBlocks[UBX_GNSS_ID_MAX]; } __attribute__((packed)); +#define UBX_CFG_NAV5_FIXMODE_2D_ONLY 1 +#define UBX_CFG_NAV5_FIXMODE_3D_ONLY 2 +#define UBX_CFG_NAV5_FIXMODE_AUTO_2D3D 3 + +#define UBX_CFG_NAV5_DYNMODEL_MASK 1 +#define UBX_CFG_NAV5_MINELEV_MASK 2 +#define UBX_CFG_NAV5_FIXMODE_MASK 4 +#define UBX_CFG_NAV5_DRLIMIT_MASK 8 +#define UBX_CFG_NAV5_POSITION_MASK 16 +#define UBX_CFG_NAV5_TIME_MASK 32 +#define UBX_CFG_NAV5_STATICHOLD_MASK 64 +#define UBX_CFG_NAV5_DGPS_MASK 128 + struct UBX_CFG_NAV5 { uint16_t mask; uint8_t dynModel; @@ -526,6 +539,13 @@ struct UBX_CFG_NAV5 { uint32_t reserved4; } __attribute__((packed)); +#define UBX_CFG_NAVX5_MIN_MAX_MASK 4 +#define UBX_CFG_NAVX5_MIN_CNO_MASK 8 +#define UBX_CFG_NAVX5_INIT_3DFIX_MASK 64 +#define UBX_CFG_NAVX5_WKN_ROLL_MASK 512 +#define UBX_CFG_NAVX5_PPP_MASK 8192 +#define UBX_CFG_NAVX5_AOP_MASK 16384 + struct UBX_CFG_NAVX5 { uint16_t version; uint16_t mask1; diff --git a/flight/modules/GPS/ubx_autoconfig.c b/flight/modules/GPS/ubx_autoconfig.c index 795c4afc6..ea44f2edf 100644 --- a/flight/modules/GPS/ubx_autoconfig.c +++ b/flight/modules/GPS/ubx_autoconfig.c @@ -310,9 +310,9 @@ static void config_nav(uint16_t *bytes_to_send) { memset((uint8_t *)status->working_packet.buffer, 0, sizeof(UBXSentHeader_t) + sizeof(ubx_cfg_nav5_t)); status->working_packet.message.payload.cfg_nav5.dynModel = status->currentSettings.dynamicModel; - status->working_packet.message.payload.cfg_nav5.fixMode = 2; // 1=2D only, 2=3D only, 3=Auto 2D/3D + status->working_packet.message.payload.cfg_nav5.fixMode = UBX_CFG_NAV5_FIXMODE_3D_ONLY; // mask LSB=dyn|minEl|posFixMode|drLim|posMask|statisticHoldMask|dgpsMask|......|reservedBit0 = MSB - status->working_packet.message.payload.cfg_nav5.mask = 0x01 + 0x04; // Dyn Model | posFixMode configuration + status->working_packet.message.payload.cfg_nav5.mask = UBX_CFG_NAV5_DYNMODEL_MASK + UBX_CFG_NAV5_FIXMODE_MASK; *bytes_to_send = prepare_packet((UBXSentPacket_t *)&status->working_packet, UBX_CLASS_CFG, UBX_ID_CFG_NAV5, sizeof(ubx_cfg_nav5_t)); } @@ -321,7 +321,7 @@ static void config_navx(uint16_t *bytes_to_send) { memset((uint8_t *)status->working_packet.buffer, 0, sizeof(UBXSentHeader_t) + sizeof(ubx_cfg_navx5_t)); status->working_packet.message.payload.cfg_navx5.useAOP = status->currentSettings.AssistNowAutonomous; - status->working_packet.message.payload.cfg_navx5.mask1 = 0x4000; // aop configuration + status->working_packet.message.payload.cfg_navx5.mask1 = UBX_CFG_NAVX5_AOP_MASK; *bytes_to_send = prepare_packet((UBXSentPacket_t *)&status->working_packet, UBX_CLASS_CFG, UBX_ID_CFG_NAVX5, sizeof(ubx_cfg_navx5_t)); } From 9dd894f4a9ff913bd7d59805f65d51d925e89b19 Mon Sep 17 00:00:00 2001 From: Laurent Lalanne Date: Sun, 3 Jul 2016 20:02:03 +0200 Subject: [PATCH 3/3] LP-354 Add comments and use byte shift. --- flight/modules/GPS/inc/UBX.h | 37 ++++++++++++++++------------- flight/modules/GPS/ubx_autoconfig.c | 4 ++-- 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/flight/modules/GPS/inc/UBX.h b/flight/modules/GPS/inc/UBX.h index e468a7b32..4615a4a15 100644 --- a/flight/modules/GPS/inc/UBX.h +++ b/flight/modules/GPS/inc/UBX.h @@ -505,18 +505,20 @@ struct UBX_CFG_GNSS { struct UBX_CFG_GNSS_CFGBLOCK cfgBlocks[UBX_GNSS_ID_MAX]; } __attribute__((packed)); -#define UBX_CFG_NAV5_FIXMODE_2D_ONLY 1 -#define UBX_CFG_NAV5_FIXMODE_3D_ONLY 2 -#define UBX_CFG_NAV5_FIXMODE_AUTO_2D3D 3 +// CFG-NAV5: Position Fixing Mode +#define UBX_CFG_NAV5_FIXMODE_2D_ONLY 0x01 +#define UBX_CFG_NAV5_FIXMODE_3D_ONLY 0x02 +#define UBX_CFG_NAV5_FIXMODE_AUTO_2D3D 0x03 -#define UBX_CFG_NAV5_DYNMODEL_MASK 1 -#define UBX_CFG_NAV5_MINELEV_MASK 2 -#define UBX_CFG_NAV5_FIXMODE_MASK 4 -#define UBX_CFG_NAV5_DRLIMIT_MASK 8 -#define UBX_CFG_NAV5_POSITION_MASK 16 -#define UBX_CFG_NAV5_TIME_MASK 32 -#define UBX_CFG_NAV5_STATICHOLD_MASK 64 -#define UBX_CFG_NAV5_DGPS_MASK 128 +// CFG-NAV5: Bitfield mask +#define UBX_CFG_NAV5_DYNMODEL (1 << 0) // Apply dynamic model settings +#define UBX_CFG_NAV5_MINELEV (1 << 1) // Apply minimum elevation settings +#define UBX_CFG_NAV5_FIXMODE (1 << 2) // Apply fix mode settings +#define UBX_CFG_NAV5_DRLIMIT (1 << 3) // Reserved +#define UBX_CFG_NAV5_POSITION (1 << 4) // Apply position mask settings +#define UBX_CFG_NAV5_TIME (1 << 5) // Apply time mask settings +#define UBX_CFG_NAV5_STATICHOLD (1 << 6) // Apply static hold settings +#define UBX_CFG_NAV5_DGPS (1 << 7) // Reserved struct UBX_CFG_NAV5 { uint16_t mask; @@ -539,12 +541,13 @@ struct UBX_CFG_NAV5 { uint32_t reserved4; } __attribute__((packed)); -#define UBX_CFG_NAVX5_MIN_MAX_MASK 4 -#define UBX_CFG_NAVX5_MIN_CNO_MASK 8 -#define UBX_CFG_NAVX5_INIT_3DFIX_MASK 64 -#define UBX_CFG_NAVX5_WKN_ROLL_MASK 512 -#define UBX_CFG_NAVX5_PPP_MASK 8192 -#define UBX_CFG_NAVX5_AOP_MASK 16384 +// CFG-NAVX5: Bitfield mask1 +#define UBX_CFG_NAVX5_MIN_MAX (1 << 2) // Apply min/max SVs settings +#define UBX_CFG_NAVX5_MIN_CNO (1 << 3) // Apply minimum C/N0 setting +#define UBX_CFG_NAVX5_INIT_3DFIX (1 << 6) // Apply initial 3D fix settings +#define UBX_CFG_NAVX5_WKN_ROLL (1 << 9) // Apply GPS weeknumber rollover settings +#define UBX_CFG_NAVX5_PPP (1 << 13) // Apply PPP flag, only supported on certain product variants +#define UBX_CFG_NAVX5_AOP (1 << 14) // Apply useAOP flag and aopOrbMaxErr setting (AssistNow Autonomous) struct UBX_CFG_NAVX5 { uint16_t version; diff --git a/flight/modules/GPS/ubx_autoconfig.c b/flight/modules/GPS/ubx_autoconfig.c index ea44f2edf..9cfb079d3 100644 --- a/flight/modules/GPS/ubx_autoconfig.c +++ b/flight/modules/GPS/ubx_autoconfig.c @@ -312,7 +312,7 @@ static void config_nav(uint16_t *bytes_to_send) status->working_packet.message.payload.cfg_nav5.dynModel = status->currentSettings.dynamicModel; status->working_packet.message.payload.cfg_nav5.fixMode = UBX_CFG_NAV5_FIXMODE_3D_ONLY; // mask LSB=dyn|minEl|posFixMode|drLim|posMask|statisticHoldMask|dgpsMask|......|reservedBit0 = MSB - status->working_packet.message.payload.cfg_nav5.mask = UBX_CFG_NAV5_DYNMODEL_MASK + UBX_CFG_NAV5_FIXMODE_MASK; + status->working_packet.message.payload.cfg_nav5.mask = UBX_CFG_NAV5_DYNMODEL + UBX_CFG_NAV5_FIXMODE; *bytes_to_send = prepare_packet((UBXSentPacket_t *)&status->working_packet, UBX_CLASS_CFG, UBX_ID_CFG_NAV5, sizeof(ubx_cfg_nav5_t)); } @@ -321,7 +321,7 @@ static void config_navx(uint16_t *bytes_to_send) { memset((uint8_t *)status->working_packet.buffer, 0, sizeof(UBXSentHeader_t) + sizeof(ubx_cfg_navx5_t)); status->working_packet.message.payload.cfg_navx5.useAOP = status->currentSettings.AssistNowAutonomous; - status->working_packet.message.payload.cfg_navx5.mask1 = UBX_CFG_NAVX5_AOP_MASK; + status->working_packet.message.payload.cfg_navx5.mask1 = UBX_CFG_NAVX5_AOP; *bytes_to_send = prepare_packet((UBXSentPacket_t *)&status->working_packet, UBX_CLASS_CFG, UBX_ID_CFG_NAVX5, sizeof(ubx_cfg_navx5_t)); }