1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-23 16:25:31 +03:00

Merge pull request #224 from basdelfos/betaflight

Cell voltage for FrSky Telemetry protocol
This commit is contained in:
borisbstyle 2016-03-01 22:05:00 +01:00
commit 16ca4ff16e

View file

@ -404,11 +404,16 @@ static void sendVoltageAmp(void)
serialize16(vbat);
} else {
uint16_t voltage = (vbat * 110) / 21;
uint16_t vfasVoltage;
if (telemetryConfig->frsky_vfas_cell_voltage) {
vfasVoltage = voltage / batteryCellCount;
} else {
vfasVoltage = voltage;
}
sendDataHead(ID_VOLTAGE_AMP_BP);
serialize16(voltage / 100);
serialize16(vfasVoltage / 100);
sendDataHead(ID_VOLTAGE_AMP_AP);
serialize16(((voltage % 100) + 5) / 10);
serialize16(((vfasVoltage % 100) + 5) / 10);
}
}