1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-26 01:35:41 +03:00

Configurable VFAS cell/full voltage

This commit is contained in:
borisbstyle 2016-02-22 11:55:33 +01:00
parent a1f30841c0
commit e3dce9f705
4 changed files with 10 additions and 1 deletions

View file

@ -326,7 +326,13 @@ void handleSmartPortTelemetry(void)
#endif
case FSSP_DATAID_VFAS :
if (feature(FEATURE_VBAT)) {
smartPortSendPackage(id, (vbat / batteryCellCount) * 10); // given in 0.1V, convert to volts
uint16_t vfasVoltage;
if (telemetryConfig->frsky_vfas_cell_voltage) {
vfasVoltage = vbat / batteryCellCount;
} else {
vfasVoltage = vbat;
}
smartPortSendPackage(id, vfasVoltage * 10); // given in 0.1V, convert to volts
smartPortHasRequest = 0;
}
break;

View file

@ -44,6 +44,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 hottAlarmSoundInterval;
} telemetryConfig_t;