From e98a7159bea9324edc87fcee701ea4de356765bf Mon Sep 17 00:00:00 2001 From: Trung N Tran Date: Thu, 30 Nov 2017 13:16:47 -0800 Subject: mg: fix rx gain on channel 1 --- host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_gain.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_gain.cpp b/host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_gain.cpp index ff4683fe5..a8eb7c6fb 100644 --- a/host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_gain.cpp +++ b/host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_gain.cpp @@ -25,6 +25,7 @@ double magnesium_radio_ctrl_impl::_set_all_gain( "freq=" << freq << " Hz, " "chan=" << chan << ", " "dir=" << dir); + size_t ad9371_chan = _master?0:1; const auto gain_tuple = get_gain_tuple(gain, freq, dir); const double ad9371_gain = ((dir == RX_DIRECTION) ? AD9371_MAX_RX_GAIN : AD9371_MAX_TX_GAIN) @@ -34,7 +35,7 @@ double magnesium_radio_ctrl_impl::_set_all_gain( "AD9371 gain==" << ad9371_gain << " dB, " "DSA attenuation == " << gain_tuple.dsa_att << " dB." ); - _ad9371->set_gain(ad9371_gain, chan, dir); + _ad9371->set_gain(ad9371_gain, ad9371_chan, dir); _dsa_set_att(gain_tuple.dsa_att, chan, dir); if (dir == RX_DIRECTION or dir == DX_DIRECTION) { _all_rx_gain = gain; -- cgit v1.2.3