1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-17 13:25:30 +03:00

Fix: CRSFv3 uplink RSSI percentage scaling to match internal 0...1023 range

This commit is contained in:
cruwaller 2021-05-27 11:23:53 +03:00
parent 12a4016ff0
commit 11a6f73e09

View file

@ -278,7 +278,7 @@ static void handleCrsfLinkStatisticsTxFrame(const crsfLinkStatisticsTx_t* statsP
lastLinkStatisticsFrameUs = currentTimeUs;
int16_t rssiDbm = -1 * stats.uplink_RSSI;
if (rssiSource == RSSI_SOURCE_RX_PROTOCOL_CRSF) {
const uint16_t rssiPercentScaled = stats.uplink_RSSI_percentage;
const uint16_t rssiPercentScaled = scaleRange(stats.uplink_RSSI_percentage, 0, 100, 0, RSSI_MAX_VALUE);
setRssi(rssiPercentScaled, RSSI_SOURCE_RX_PROTOCOL_CRSF);
}
#ifdef USE_RX_RSSI_DBM