From 4ada3d90d97b0926e4f39f949ed789cb9c85f3e3 Mon Sep 17 00:00:00 2001 From: Erik Gustavsson Date: Sat, 28 Feb 2015 13:17:22 +0100 Subject: [PATCH] OP-1739 Add "Default" setting to GNSSMode which skips the GNSS selection during autoconfig, e.g. for use with UBX6 --- flight/modules/GPS/GPS.c | 6 +++++- flight/modules/GPS/ubx_autoconfig.c | 9 +++++++-- shared/uavobjectdefinition/gpssettings.xml | 2 +- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/flight/modules/GPS/GPS.c b/flight/modules/GPS/GPS.c index 8dbcd7b57..99708d05d 100644 --- a/flight/modules/GPS/GPS.c +++ b/flight/modules/GPS/GPS.c @@ -553,10 +553,14 @@ void updateGpsSettings(__attribute__((unused)) UAVObjEvent *ev) newconfig.enableGPS = false; newconfig.enableGLONASS = true; break; - default: + case GPSSETTINGS_UBXGNSSMODE_GPS: newconfig.enableGPS = true; newconfig.enableGLONASS = false; break; + default: + newconfig.enableGPS = false; + newconfig.enableGLONASS = false; + break; } ubx_autoconfig_set(newconfig); diff --git a/flight/modules/GPS/ubx_autoconfig.c b/flight/modules/GPS/ubx_autoconfig.c index 67cb887f0..c24c47f8f 100644 --- a/flight/modules/GPS/ubx_autoconfig.c +++ b/flight/modules/GPS/ubx_autoconfig.c @@ -296,8 +296,13 @@ static void configure(uint16_t *bytes_to_send) config_nav(bytes_to_send); break; case LAST_CONFIG_SENT_START + 2: - config_gnss(bytes_to_send); - break; + if (status->currentSettings.enableGLONASS || status->currentSettings.enableGPS) { + config_gnss(bytes_to_send); + break; + } else { + // Skip and fall through to next step + status->lastConfigSent++; + } case LAST_CONFIG_SENT_START + 3: config_sbas(bytes_to_send); if (!status->currentSettings.storeSettings) { diff --git a/shared/uavobjectdefinition/gpssettings.xml b/shared/uavobjectdefinition/gpssettings.xml index 5caf23c15..b16054387 100644 --- a/shared/uavobjectdefinition/gpssettings.xml +++ b/shared/uavobjectdefinition/gpssettings.xml @@ -17,7 +17,7 @@ - +