1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-24 16:55:36 +03:00

Merge pull request #3143 from mikeller/unify_frsky_ibus_voltage_setting

Unified 'frsky_vfas_cell_voltage' and 'ibus_report_cell_voltage' into 'report_cell_voltage'.
This commit is contained in:
Michael Keller 2017-05-28 23:35:01 +12:00 committed by GitHub
commit c287e688b7
4 changed files with 4 additions and 5 deletions

View file

@ -601,11 +601,10 @@ const clivalue_t valueTable[] = {
{ "frsky_gps_format", VAR_UINT8 | MASTER_VALUE, .config.minmax = { 0, FRSKY_FORMAT_NMEA }, PG_TELEMETRY_CONFIG, offsetof(telemetryConfig_t, frsky_coordinate_format) },
{ "frsky_unit", VAR_UINT8 | MASTER_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_UNIT }, PG_TELEMETRY_CONFIG, offsetof(telemetryConfig_t, frsky_unit) },
{ "frsky_vfas_precision", VAR_UINT8 | MASTER_VALUE, .config.minmax = { FRSKY_VFAS_PRECISION_LOW, FRSKY_VFAS_PRECISION_HIGH }, PG_TELEMETRY_CONFIG, offsetof(telemetryConfig_t, frsky_vfas_precision) },
{ "frsky_vfas_cell_voltage", VAR_UINT8 | MASTER_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_OFF_ON }, PG_TELEMETRY_CONFIG, offsetof(telemetryConfig_t, frsky_vfas_cell_voltage) },
{ "hott_alarm_int", VAR_UINT8 | MASTER_VALUE, .config.minmax = { 0, 120 }, PG_TELEMETRY_CONFIG, offsetof(telemetryConfig_t, hottAlarmSoundInterval) },
{ "pid_in_tlm", VAR_UINT8 | MASTER_VALUE | MODE_LOOKUP, .config.lookup = {TABLE_OFF_ON }, PG_TELEMETRY_CONFIG, offsetof(telemetryConfig_t, pidValuesAsTelemetry) },
#if defined(TELEMETRY_IBUS)
{ "ibus_report_cell_voltage", VAR_UINT8 | MASTER_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_OFF_ON }, PG_TELEMETRY_CONFIG, offsetof(telemetryConfig_t, report_cell_voltage) },
{ "report_cell_voltage", VAR_UINT8 | MASTER_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_OFF_ON }, PG_TELEMETRY_CONFIG, offsetof(telemetryConfig_t, report_cell_voltage) },
#endif
#endif

View file

@ -416,7 +416,7 @@ static void sendVoltageAmp(void)
} else {
uint16_t voltage = (batteryVoltage * 110) / 21;
uint16_t vfasVoltage;
if (telemetryConfig()->frsky_vfas_cell_voltage) {
if (telemetryConfig()->report_cell_voltage) {
vfasVoltage = voltage / getBatteryCellCount();
} else {
vfasVoltage = voltage;

View file

@ -619,7 +619,7 @@ void handleSmartPortTelemetry(void)
case FSSP_DATAID_VFAS :
if (batteryConfig()->voltageMeterSource != VOLTAGE_METER_NONE && getBatteryCellCount() > 0) {
uint16_t vfasVoltage;
if (telemetryConfig()->frsky_vfas_cell_voltage) {
if (telemetryConfig()->report_cell_voltage) {
vfasVoltage = getBatteryVoltage() / getBatteryCellCount();
} else {
vfasVoltage = getBatteryVoltage();

View file

@ -46,7 +46,7 @@ typedef struct telemetryConfig_s {
frskyGpsCoordFormat_e frsky_coordinate_format;
frskyUnit_e frsky_unit;
uint8_t frsky_vfas_precision;
uint8_t frsky_vfas_cell_voltage;
uint8_t frsky_vfas_cell_voltage; // Unused. Use 'report_cell_voltage' instead.
uint8_t hottAlarmSoundInterval;
uint8_t pidValuesAsTelemetry;
uint8_t report_cell_voltage;