mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-18 22:05:17 +03:00
Fix arming when GPS included in build but no active GNSS device attached + revert msp request for SatInfo (#13244)
* Fix arming when GPS included in build but not active * Fixes per review from Chris * Move PG change to new PR * Restore changing GPS PG version
This commit is contained in:
parent
22ce586550
commit
9b078c0b1f
7 changed files with 17 additions and 27 deletions
|
@ -484,9 +484,6 @@ if (systemConfig()->configurationState == CONFIGURATION_STATE_UNCONFIGURED) {
|
|||
#ifdef USE_DASHBOARD
|
||||
featureEnableImmediate(FEATURE_DASHBOARD);
|
||||
#endif
|
||||
#ifdef USE_GPS
|
||||
featureEnableImmediate(FEATURE_GPS);
|
||||
#endif
|
||||
#ifdef USE_LED_STRIP
|
||||
featureEnableImmediate(FEATURE_LED_STRIP);
|
||||
#endif
|
||||
|
|
|
@ -580,9 +580,10 @@ void tryArm(void)
|
|||
lastArmingDisabledReason = 0;
|
||||
|
||||
#ifdef USE_GPS
|
||||
GPS_reset_home_position();
|
||||
//beep to indicate arming
|
||||
if (featureIsEnabled(FEATURE_GPS)) {
|
||||
GPS_reset_home_position();
|
||||
|
||||
if (STATE(GPS_FIX) && gpsSol.numSat >= gpsRescueConfig()->minSats) {
|
||||
beeper(BEEPER_ARMING_GPS_FIX);
|
||||
} else {
|
||||
|
|
|
@ -329,9 +329,10 @@ typedef enum {
|
|||
UBLOX_MSG_STATUS, // 15: set STATUS MSG rate
|
||||
UBLOX_MSG_VELNED, // 16. set VELNED MSG rate
|
||||
UBLOX_MSG_DOP, // 17. MSG_NAV_DOP
|
||||
UBLOX_SET_NAV_RATE, // 18. set to user requested GPS sample rate
|
||||
UBLOX_MSG_CFG_GNSS, // 19. For not SBAS or GALILEO
|
||||
UBLOX_CONFIG_COMPLETE // 20. Config finished, start receiving data
|
||||
UBLOX_SAT_INFO, // 18. MSG_NAV_SAT message
|
||||
UBLOX_SET_NAV_RATE, // 19. set to user requested GPS sample rate
|
||||
UBLOX_MSG_CFG_GNSS, // 20. For not SBAS or GALILEO
|
||||
UBLOX_CONFIG_COMPLETE // 21. Config finished, start receiving data
|
||||
} ubloxStatePosition_e;
|
||||
|
||||
baudRate_e initBaudRateIndex;
|
||||
|
@ -366,16 +367,6 @@ static void logErrorToPacketLog(void)
|
|||
}
|
||||
#endif // USE_DASHBOARD
|
||||
|
||||
// Enable sat info using MSP request
|
||||
#ifdef USE_GPS_UBLOX
|
||||
void gpsRequestSatInfo(void)
|
||||
{
|
||||
if (!ARMING_FLAG(ARMED)) {
|
||||
setSatInfoMessageRate(5);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static void gpsNewData(uint16_t c);
|
||||
#ifdef USE_GPS_NMEA
|
||||
static bool gpsNewFrameNMEA(char c);
|
||||
|
@ -1108,6 +1099,11 @@ void gpsConfigureUblox(void)
|
|||
break;
|
||||
}
|
||||
|
||||
// Add delay to stabilize the connection
|
||||
if (cmp32(gpsData.now, gpsData.state_ts) < 1000) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (gpsData.ackState == UBLOX_ACK_IDLE) {
|
||||
|
||||
// short delay before between commands, including the first command
|
||||
|
@ -1232,6 +1228,10 @@ void gpsConfigureUblox(void)
|
|||
ubloxSetMessageRate(CLASS_NAV, MSG_NAV_DOP, 1);
|
||||
}
|
||||
break;
|
||||
case UBLOX_SAT_INFO:
|
||||
// enable by default, turned off when armed and receiving data to reduce in-flight traffic
|
||||
setSatInfoMessageRate(5);
|
||||
break;
|
||||
case UBLOX_SET_NAV_RATE:
|
||||
// set the nav solution rate to the user's configured update rate
|
||||
gpsData.updateRateHz = gpsConfig()->gps_update_rate_hz;
|
||||
|
@ -2559,7 +2559,7 @@ void GPS_reset_home_position(void)
|
|||
|
||||
#ifdef USE_GPS_UBLOX
|
||||
// disable Sat Info requests on arming
|
||||
if (ARMING_FLAG(ARMED)) {
|
||||
if (gpsConfig()->provider == GPS_UBLOX) {
|
||||
setSatInfoMessageRate(0);
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -381,7 +381,6 @@ extern uint32_t dashboardGpsNavSvInfoRcvCount; // Count of time
|
|||
|
||||
#ifdef USE_GPS_UBLOX
|
||||
ubloxVersion_e ubloxParseVersion(const uint32_t version);
|
||||
void gpsRequestSatInfo(void);
|
||||
void setSatInfoMessageRate(uint8_t divisor);
|
||||
#endif
|
||||
|
||||
|
|
|
@ -4052,12 +4052,6 @@ static mspResult_e mspProcessInCommand(mspDescriptor_t srcDesc, int16_t cmdMSP,
|
|||
break;
|
||||
#endif
|
||||
|
||||
#ifdef USE_GPS_UBLOX
|
||||
case MSP2_UBLOX_REQUEST_SV_INFO:
|
||||
gpsRequestSatInfo();
|
||||
break;
|
||||
#endif
|
||||
|
||||
default:
|
||||
// we do not know how to handle the (valid) message, indicate error MSP $M!
|
||||
return MSP_RESULT_ERROR;
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
#define MSP2_GET_LED_STRIP_CONFIG_VALUES 0x3008
|
||||
#define MSP2_SET_LED_STRIP_CONFIG_VALUES 0x3009
|
||||
#define MSP2_SENSOR_CONFIG_ACTIVE 0x300A
|
||||
#define MSP2_UBLOX_REQUEST_SV_INFO 0x300B
|
||||
|
||||
// MSP2_SET_TEXT and MSP2_GET_TEXT variable types
|
||||
#define MSP2TEXT_PILOT_NAME 1
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
#include "gps.h"
|
||||
|
||||
PG_REGISTER_WITH_RESET_TEMPLATE(gpsConfig_t, gpsConfig, PG_GPS_CONFIG, 4);
|
||||
PG_REGISTER_WITH_RESET_TEMPLATE(gpsConfig_t, gpsConfig, PG_GPS_CONFIG, 3);
|
||||
|
||||
PG_RESET_TEMPLATE(gpsConfig_t, gpsConfig,
|
||||
.provider = GPS_UBLOX,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue