1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-20 10:54:14 +01:00

OP-1464 Compile warning discovery Remove AbConfStoreDisable

This commit is contained in:
Cliff Geerdes 2015-05-20 01:04:06 -04:00
parent 244c9e2d5e
commit 55a43d1815
4 changed files with 28 additions and 5 deletions

View File

@ -498,7 +498,9 @@ void gps_set_fc_baud_from_arg(uint8_t baud)
// must updateHwSettings() before updateGpsSettings() so baud rate is set before GPS serial code starts running
static void updateHwSettings(UAVObjEvent __attribute__((unused)) *ev)
{
#if defined(PIOS_INCLUDE_GPS_UBX_PARSER) && !defined(PIOS_GPS_MINIMAL)
static uint32_t previousGpsPort=0xf0f0f0f0; // = doesn't match gpsport
#endif
// if GPS (UBX or NMEA) is enabled at all
if (gpsPort && gpsEnabled) {
// on first use of this port (previousGpsPort != gpsPort) we must set the Revo port baud rate
@ -529,7 +531,9 @@ static void updateHwSettings(UAVObjEvent __attribute__((unused)) *ev)
}
#endif
}
#if defined(PIOS_INCLUDE_GPS_UBX_PARSER) && !defined(PIOS_GPS_MINIMAL)
previousGpsPort = gpsPort;
#endif
}

View File

@ -154,6 +154,10 @@ ubx_cfg_msg_t msg_config_ubx7[] = {
// note that a reset is always done with autoconfig.store
// #define ALWAYS_RESET
// we can enable this when we know how to make the Flight Controller save an object to permanent storage
// also see comment about simple edit in gpssettings.xml
// #define AUTOBAUD_CONFIGURE_STORE_AND_DISABLE
// private variables
// enable the autoconfiguration system
@ -452,6 +456,7 @@ static void enable_sentences(__attribute__((unused)) uint16_t *bytes_to_send)
}
#if defined(AUTOBAUD_CONFIGURE_STORE_AND_DISABLE)
// permanently store our version of GPSSettings.UbxAutoConfig
// we use this to disable after AbConfigStoreAndDisable is complete
// FIXME: this does not store it permanently
@ -466,6 +471,7 @@ static void setGpsSettings()
status->gpsSettings.UbxAutoConfig = status->currentSettings.UbxAutoConfig;
GPSSettingsSet((void *) &status->gpsSettings);
}
#endif
// 9600 baud and lower are not usable, and are best left at factory default
@ -609,7 +615,10 @@ void gps_ubx_autoconfig_run(char * *buffer, uint16_t *bytes_to_send)
// that makes sure that all strange settings are reset to factory default
// else these strange settings may persist because we don't reset all settings by table
if (status->currentSettings.UbxAutoConfig == GPSSETTINGS_UBXAUTOCONFIG_ABCONFIGANDSTORE
|| status->currentSettings.UbxAutoConfig == GPSSETTINGS_UBXAUTOCONFIG_ABCONFIGSTOREANDDISABLE)
#if defined(AUTOBAUD_CONFIGURE_STORE_AND_DISABLE)
|| status->currentSettings.UbxAutoConfig == GPSSETTINGS_UBXAUTOCONFIG_ABCONFIGSTOREANDDISABLE
#endif
)
#endif
{
// reset all GPS parameters to factory default (configure low rate NMEA for low baud rates)
@ -631,7 +640,10 @@ void gps_ubx_autoconfig_run(char * *buffer, uint16_t *bytes_to_send)
// that makes sure that all strange settings are reset to factory default
// else these strange settings may persist because we don't reset all settings by hand
if (status->currentSettings.UbxAutoConfig == GPSSETTINGS_UBXAUTOCONFIG_ABCONFIGANDSTORE
|| status->currentSettings.UbxAutoConfig == GPSSETTINGS_UBXAUTOCONFIG_ABCONFIGSTOREANDDISABLE)
#if defined(AUTOBAUD_CONFIGURE_STORE_AND_DISABLE)
|| status->currentSettings.UbxAutoConfig == GPSSETTINGS_UBXAUTOCONFIG_ABCONFIGSTOREANDDISABLE
#endif
)
#endif
{
// wait for previous step
@ -757,7 +769,10 @@ void gps_ubx_autoconfig_run(char * *buffer, uint16_t *bytes_to_send)
case INIT_STEP_SAVE:
// now decide whether to save them permanently into the GPS
if (status->currentSettings.UbxAutoConfig == GPSSETTINGS_UBXAUTOCONFIG_ABCONFIGANDSTORE
|| status->currentSettings.UbxAutoConfig == GPSSETTINGS_UBXAUTOCONFIG_ABCONFIGSTOREANDDISABLE) {
#if defined(AUTOBAUD_CONFIGURE_STORE_AND_DISABLE)
|| status->currentSettings.UbxAutoConfig == GPSSETTINGS_UBXAUTOCONFIG_ABCONFIGSTOREANDDISABLE
#endif
) {
config_save(bytes_to_send);
set_current_step_if_untouched(INIT_STEP_SAVE_WAIT_ACK);
status->lastStepTimestampRaw = PIOS_DELAY_GetRaw();
@ -781,6 +796,7 @@ void gps_ubx_autoconfig_run(char * *buffer, uint16_t *bytes_to_send)
// the autoconfig has completed normally
case INIT_STEP_PRE_DONE:
#if defined(AUTOBAUD_CONFIGURE_STORE_AND_DISABLE)
// determine if we need to disable autoconfig via the autoconfig==CONFIGSTOREANDDISABLE setting
if (status->currentSettings.UbxAutoConfig == GPSSETTINGS_UBXAUTOCONFIG_ABCONFIGSTOREANDDISABLE) {
enabled = false;
@ -788,6 +804,7 @@ void gps_ubx_autoconfig_run(char * *buffer, uint16_t *bytes_to_send)
// like it says
setGpsSettings();
}
#endif
set_current_step_if_untouched(INIT_STEP_DONE);
break;

View File

@ -176,14 +176,15 @@ void VehicleConfigurationHelper::applyHardwareConfiguration()
GPSSettings *gpsSettings = GPSSettings::GetInstance(m_uavoManager);
Q_ASSERT(gpsSettings);
GPSSettings::DataFields gpsData = gpsSettings->getData();
gpsData.UbxAutoConfig = GPSSettings::UBXAUTOCONFIG_DISABLED;
switch (m_configSource->getGpsType()) {
case VehicleConfigurationSource::GPS_NMEA:
gpsData.DataProtocol = GPSSettings::DATAPROTOCOL_NMEA;
gpsData.UbxAutoConfig = GPSSettings::UBXAUTOCONFIG_DISABLED;
break;
case VehicleConfigurationSource::GPS_UBX:
gpsData.DataProtocol = GPSSettings::DATAPROTOCOL_UBX;
gpsData.UbxAutoConfig = GPSSettings::UBXAUTOCONFIG_ABANDCONFIGURE;
break;
case VehicleConfigurationSource::GPS_PLATINUM:
{

View File

@ -6,7 +6,8 @@
<field name="MaxPDOP" units="" type="float" elements="1" defaultvalue="3.5"/>
<!-- Ubx self configuration. Enable to allow the flight board to auto configure ubx GPS options,
store does AutoConfig and save GPS settings (i.e. to prevent issues if gps is power cycled) -->
<field name="UbxAutoConfig" units="" type="enum" elements="1" options="Disabled,AutoBaud,AbAndConfigure,AbConfigAndStore,AbConfigStoreAndDisable" defaultvalue="AbAndConfigure"/>
<!-- add AbConfigStoreAndDisable after AbConfigAndStore and uncomment AUTOBAUD_CONFIGURE_STORE_AND_DISABLE in ubx_autoconfig.c-->
<field name="UbxAutoConfig" units="" type="enum" elements="1" options="Disabled,AutoBaud,AbAndConfigure,AbConfigAndStore" defaultvalue="AbAndConfigure"/>
<!-- Ubx position update rate, -1 for auto -->
<field name="UbxRate" units="Hz" type="int8" elements="1" defaultvalue="5" />
<!-- Ubx dynamic model, see UBX datasheet for more details -->