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:
commit
16ca4ff16e
1 changed files with 8 additions and 3 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue