Skip to content

Commit

Permalink
fix antenna value for Diversity/Gemini receivers (ExpressLRS#2622)
Browse files Browse the repository at this point in the history
  • Loading branch information
JyeSmith authored Apr 1, 2024
1 parent 62faf7f commit 05ebcfe
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/src/rx_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,11 +251,6 @@ static uint8_t minLqForChaos()

void ICACHE_RAM_ATTR getRFlinkInfo()
{
if (GPIO_PIN_NSS_2 != UNDEF_PIN)
{
antenna = (Radio.GetProcessingPacketRadio() == SX12XX_Radio_1) ? 0 : 1;
}

int32_t rssiDBM = Radio.LastPacketRSSI;

if (GPIO_PIN_NSS_2 != UNDEF_PIN)
Expand All @@ -272,7 +267,7 @@ void ICACHE_RAM_ATTR getRFlinkInfo()
// BetaFlight/iNav expect positive values for -dBm (e.g. -80dBm -> sent as 80)
CRSF::LinkStatistics.uplink_RSSI_1 = -rssiDBM;
CRSF::LinkStatistics.uplink_RSSI_2 = -rssiDBM2;
antenna = (rssiDBM > rssiDBM2)? 0 : 1; // report a better antenna for the reception
antenna = (Radio.GetProcessingPacketRadio() == SX12XX_Radio_1) ? 0 : 1;
}
else if (antenna == 0)
{
Expand Down

0 comments on commit 05ebcfe

Please sign in to comment.