1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-25 01:05:27 +03:00

Fixed review

This commit is contained in:
Filipp Bakanov 2022-01-29 11:48:10 +03:00
parent e19469c0ba
commit 674d3b1e3b
No known key found for this signature in database
GPG key ID: A8B7CC1737CDF1D2
2 changed files with 7 additions and 3 deletions

View file

@ -1719,7 +1719,7 @@ const clivalue_t valueTable[] = {
// PG_POSITION
{ "position_alt_source", VAR_INT8 | MASTER_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_POSITION_ALT_SOURCE }, PG_POSITION, offsetof(positionConfig_t, altSource) },
{ "position_alt_num_gps_sats", VAR_INT8 | MASTER_VALUE, .config.minmaxUnsigned = { 4, 50 }, PG_POSITION, offsetof(positionConfig_t, altNumSatsGpsUse) },
{ "position_alt_num_baro_fallback", VAR_INT8 | MASTER_VALUE, .config.minmaxUnsigned = { 4, 50 }, PG_POSITION, offsetof(positionConfig_t, altNumSatsBaroFallback) },
{ "position_alt_num_baro_fallback_sats", VAR_INT8 | MASTER_VALUE, .config.minmaxUnsigned = { 4, 50 }, PG_POSITION, offsetof(positionConfig_t, altNumSatsBaroFallback) },
// PG_MODE_ACTIVATION_CONFIG
#if defined(USE_CUSTOM_BOX_NAMES)
{ "box_user_1_name", VAR_UINT8 | HARDWARE_VALUE | MODE_STRING, .config.string = { 1, MAX_BOX_USER_NAME_LENGTH, STRING_FLAGS_NONE }, PG_MODE_ACTIVATION_CONFIG, offsetof(modeActivationConfig_t, box_user_1_name) },

View file

@ -157,6 +157,10 @@ void calculateEstimatedAltitude(timeUs_t currentTimeUs)
if (haveBaroAlt) {
goodGpsSats = positionConfig()->altNumSatsGpsUse;
badGpsSats = positionConfig()->altNumSatsBaroFallback;
if (badGpsSats >= goodGpsSats) {
badGpsSats = goodGpsSats - 1;
positionConfigMutable()->altNumSatsBaroFallback = badGpsSats;
}
}
if (ARMING_FLAG(ARMED)) {