Skip to content

Commit

Permalink
Fix myriadrf#99 chip channel selection when setting generic gains
Browse files Browse the repository at this point in the history
  • Loading branch information
rjonaitis committed Aug 25, 2024
1 parent cca28bd commit 6d139cd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/boards/LMS7002M_SDRDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,7 @@ OpStatus LMS7002M_SDRDevice::SetGain(uint8_t moduleIndex, TRXDir direction, uint

OpStatus LMS7002M_SDRDevice::SetGenericTxGain(lime::LMS7002M& chip, LMS7002M::Channel channel, double value)
{
LMS7002M::ChannelScope scope(&chip, channel);
if (chip.SetTRFPAD_dB(value, channel) != OpStatus::Success)
return OpStatus::Error;

Expand All @@ -424,6 +425,7 @@ OpStatus LMS7002M_SDRDevice::SetGenericTxGain(lime::LMS7002M& chip, LMS7002M::Ch

OpStatus LMS7002M_SDRDevice::SetGenericRxGain(lime::LMS7002M& chip, LMS7002M::Channel channel, double value)
{
LMS7002M::ChannelScope scope(&chip, channel);
value = std::clamp(static_cast<int>(value + 12), 0, MAXIMUM_GAIN_VALUE - 1);

unsigned int lna = LNATable.at(std::lround(value));
Expand Down

0 comments on commit 6d139cd

Please sign in to comment.