mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-17 13:25:30 +03:00
Returned back to config
This commit is contained in:
parent
ca0f25b265
commit
4bda34b66b
3 changed files with 10 additions and 4 deletions
|
@ -1717,7 +1717,9 @@ const clivalue_t valueTable[] = {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// PG_POSITION
|
// 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_source", VAR_INT8 | MASTER_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_POSITION_ALT_SOURCE }, PG_POSITION, offsetof(positionConfig_t, altSource) },
|
||||||
|
{ "position_alt_num_sats_gps_use", 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) },
|
||||||
// PG_MODE_ACTIVATION_CONFIG
|
// PG_MODE_ACTIVATION_CONFIG
|
||||||
#if defined(USE_CUSTOM_BOX_NAMES)
|
#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) },
|
{ "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) },
|
||||||
|
|
|
@ -52,10 +52,12 @@ typedef enum {
|
||||||
GPS_ONLY
|
GPS_ONLY
|
||||||
} altSource_e;
|
} altSource_e;
|
||||||
|
|
||||||
PG_REGISTER_WITH_RESET_TEMPLATE(positionConfig_t, positionConfig, PG_POSITION, 1);
|
PG_REGISTER_WITH_RESET_TEMPLATE(positionConfig_t, positionConfig, PG_POSITION, 2);
|
||||||
|
|
||||||
PG_RESET_TEMPLATE(positionConfig_t, positionConfig,
|
PG_RESET_TEMPLATE(positionConfig_t, positionConfig,
|
||||||
.altSource = DEFAULT,
|
.altSource = DEFAULT,
|
||||||
|
.altNumSatsGpsUse = 10,
|
||||||
|
.altNumSatsBaroFallback = 7,
|
||||||
);
|
);
|
||||||
|
|
||||||
static int32_t estimatedAltitudeCm = 0; // in cm
|
static int32_t estimatedAltitudeCm = 0; // in cm
|
||||||
|
@ -153,8 +155,8 @@ void calculateEstimatedAltitude(timeUs_t currentTimeUs)
|
||||||
int badGpsSats = 0;
|
int badGpsSats = 0;
|
||||||
|
|
||||||
if (haveBaroAlt) {
|
if (haveBaroAlt) {
|
||||||
goodGpsSats = 10;
|
goodGpsSats = positionConfig()->altNumSatsGpsUse;
|
||||||
badGpsSats = 7;
|
badGpsSats = positionConfig()->altNumSatsBaroFallback;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ARMING_FLAG(ARMED)) {
|
if (ARMING_FLAG(ARMED)) {
|
||||||
|
|
|
@ -24,6 +24,8 @@
|
||||||
|
|
||||||
typedef struct positionConfig_s {
|
typedef struct positionConfig_s {
|
||||||
uint8_t altSource;
|
uint8_t altSource;
|
||||||
|
uint8_t altNumSatsGpsUse;
|
||||||
|
uint8_t altNumSatsBaroFallback;
|
||||||
} positionConfig_t;
|
} positionConfig_t;
|
||||||
|
|
||||||
PG_DECLARE(positionConfig_t, positionConfig);
|
PG_DECLARE(positionConfig_t, positionConfig);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue