mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-23 16:25:31 +03:00
Merge pull request #9587 from mikeller/fix_crsf_rssi_collection
Fixed collection of RSSI data for CRSF.
This commit is contained in:
parent
6da2c5e6e5
commit
d4e74e39c1
1 changed files with 4 additions and 4 deletions
|
@ -159,14 +159,14 @@ static void handleCrsfLinkStatisticsFrame(const crsfLinkStatistics_t* statsPtr,
|
|||
{
|
||||
const crsfLinkStatistics_t stats = *statsPtr;
|
||||
lastLinkStatisticsFrameUs = currentTimeUs;
|
||||
const uint8_t rssiDbm = stats.active_antenna ? stats.uplink_RSSI_2 : stats.uplink_RSSI_1;
|
||||
if (rssiSource == RSSI_SOURCE_RX_PROTOCOL_CRSF) {
|
||||
const uint8_t rssiDbm = stats.active_antenna ? stats.uplink_RSSI_2 : stats.uplink_RSSI_1;
|
||||
#ifdef USE_RX_RSSI_DBM
|
||||
setRssiDbm(rssiDbm, RSSI_SOURCE_RX_PROTOCOL_CRSF);
|
||||
#endif
|
||||
const uint16_t rssiPercentScaled = scaleRange(rssiDbm, 130, 0, 0, RSSI_MAX_VALUE);
|
||||
setRssi(rssiPercentScaled, RSSI_SOURCE_RX_PROTOCOL_CRSF);
|
||||
}
|
||||
#ifdef USE_RX_RSSI_DBM
|
||||
setRssiDbm(rssiDbm, RSSI_SOURCE_RX_PROTOCOL_CRSF);
|
||||
#endif
|
||||
|
||||
#ifdef USE_RX_LINK_QUALITY_INFO
|
||||
if (linkQualitySource == LQ_SOURCE_RX_PROTOCOL_CRSF) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue