Spektrum TM, added support for cell voltage.

This commit is contained in:
Anders Hoglund 2019-02-17 22:52:36 +01:00
parent 966971c750
commit 8a67fe2ad8
1 changed files with 5 additions and 2 deletions

View File

@ -155,9 +155,12 @@ bool srxlFrameRpm(sbuf_t *dst, timeUs_t currentTimeUs)
sbufWriteU8(dst, SRXL_FRAMETYPE_TELE_RPM);
sbufWriteU8(dst, SRXL_FRAMETYPE_SID);
sbufWriteU16BigEndian(dst, 0xFFFF); // pulse leading edges
sbufWriteU16BigEndian(dst, getBatteryVoltage()); // vbat is in units of 0.01V
if (telemetryConfig()->report_cell_voltage) {
sbufWriteU16BigEndian(dst, getBatteryAverageCellVoltage()); // Cell voltage is in units of 0.01V
} else {
sbufWriteU16BigEndian(dst, getBatteryVoltage()); // vbat is in units of 0.01V
}
sbufWriteU16BigEndian(dst, 0x7FFF); // temperature
sbufFill(dst, 0xFF, STRU_TELE_RPM_EMPTY_FIELDS_COUNT);
return true;
}