Skip to content

Commit

Permalink
Merge branch 'master' into add-acc-adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
rotorflight authored May 20, 2024
2 parents 0164149 + 84f39c4 commit 2650d62
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main/cli/settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ const char * const lookupTableCrsfGpsReuse[] = {
};

const char * const lookupTableCrsfGpsSatsReuse[] = {
"NONE", "ESC_TEMP", "MCU_TEMP", "PROFILE", "RATE_PROFILE", "LED_PROFILE",
"NONE", "ESC_TEMP", "MCU_TEMP", "PROFILE", "RATE_PROFILE", "LED_PROFILE", "MODEL_ID",
};

const char * const lookupTableDtermMode[] = {
Expand Down Expand Up @@ -969,7 +969,6 @@ const clivalue_t valueTable[] = {
{ "auto_disarm_delay", VAR_UINT8 | MASTER_VALUE, .config.minmaxUnsigned = { 0, 60 }, PG_ARMING_CONFIG, offsetof(armingConfig_t, auto_disarm_delay) },
{ PARAM_NAME_GYRO_CAL_ON_FIRST_ARM, VAR_UINT8 | MASTER_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_OFF_ON }, PG_ARMING_CONFIG, offsetof(armingConfig_t, gyro_cal_on_first_arm) },


// PG_GPS_CONFIG
#ifdef USE_GPS
{ "gps_provider", VAR_UINT8 | MASTER_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_GPS_PROVIDER }, PG_GPS_CONFIG, offsetof(gpsConfig_t, provider) },
Expand Down Expand Up @@ -1675,10 +1674,13 @@ const clivalue_t valueTable[] = {
{ "stats_total_time_s", VAR_UINT32 | MASTER_VALUE, .config.u32Max = UINT32_MAX, PG_STATS_CONFIG, offsetof(statsConfig_t, stats_total_time_s) },
{ "stats_total_dist_m", VAR_UINT32 | MASTER_VALUE, .config.u32Max = UINT32_MAX, PG_STATS_CONFIG, offsetof(statsConfig_t, stats_total_dist_m) },
#endif

// PG_PILOT_CONFIG
{ "name", VAR_UINT8 | MASTER_VALUE | MODE_STRING, .config.string = { 1, MAX_NAME_LENGTH, STRING_FLAGS_NONE }, PG_PILOT_CONFIG, offsetof(pilotConfig_t, name) },
#ifdef USE_OSD
{ "display_name", VAR_UINT8 | MASTER_VALUE | MODE_STRING, .config.string = { 1, MAX_NAME_LENGTH, STRING_FLAGS_NONE }, PG_PILOT_CONFIG, offsetof(pilotConfig_t, displayName) },
#endif
{ "model_id", VAR_UINT8 | MASTER_VALUE, .config.minmaxUnsigned = { 0, 99 }, PG_PILOT_CONFIG, offsetof(pilotConfig_t, modelId) },

// PG_POSITION
{ "position_alt_source", VAR_UINT8 | MASTER_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_POSITION_ALT_SOURCE }, PG_POSITION, offsetof(positionConfig_t, alt_source) },
Expand Down
1 change: 1 addition & 0 deletions src/main/config/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ PG_REGISTER_WITH_RESET_TEMPLATE(pilotConfig_t, pilotConfig, PG_PILOT_CONFIG, 1);
PG_RESET_TEMPLATE(pilotConfig_t, pilotConfig,
.name = { 0 },
.displayName = { 0 },
.modelId = 0,
);

PG_REGISTER_WITH_RESET_TEMPLATE(systemConfig_t, systemConfig, PG_SYSTEM_CONFIG, 3);
Expand Down
1 change: 1 addition & 0 deletions src/main/config/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ typedef enum {
typedef struct pilotConfig_s {
char name[MAX_NAME_LENGTH + 1];
char displayName[MAX_NAME_LENGTH + 1];
uint8_t modelId;
} pilotConfig_t;

PG_DECLARE(pilotConfig_t, pilotConfig);
Expand Down
2 changes: 2 additions & 0 deletions src/main/telemetry/crsf.c
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,8 @@ static int8_t crsfGpsSatsReuse(uint8_t reuse, int8_t value)
return getCurrentPidProfileIndex() + 1;
case CRSF_GPS_SATS_REUSE_RATE_PROFILE:
return getCurrentControlRateProfileIndex() + 1;
case CRSF_GPS_SATS_REUSE_MODEL_ID:
return pilotConfig()->modelId;
case CRSF_GPS_SATS_REUSE_LED_PROFILE:
#ifdef USE_LED_STRIP
return getLedProfile() + 1;
Expand Down
1 change: 1 addition & 0 deletions src/main/telemetry/crsf.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ enum {
CRSF_GPS_SATS_REUSE_PROFILE,
CRSF_GPS_SATS_REUSE_RATE_PROFILE,
CRSF_GPS_SATS_REUSE_LED_PROFILE,
CRSF_GPS_SATS_REUSE_MODEL_ID,
};

void initCrsfTelemetry(void);
Expand Down

0 comments on commit 2650d62

Please sign in to comment.