aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_gain.cpp
diff options
context:
space:
mode:
authorTrung Tran <trung.tran@ettus.com>2017-12-02 07:48:04 -0800
committerMartin Braun <martin.braun@ettus.com>2017-12-22 15:05:57 -0800
commit6fa0db94f1e84f180c2bbd9946bb8152ef8a21fe (patch)
treed79de9364302190c158ceec06e5f1f3414fdf78c /host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_gain.cpp
parent0cb800e001fc443b82f827119597cb2b8167c031 (diff)
downloaduhd-6fa0db94f1e84f180c2bbd9946bb8152ef8a21fe.tar.gz
uhd-6fa0db94f1e84f180c2bbd9946bb8152ef8a21fe.tar.bz2
uhd-6fa0db94f1e84f180c2bbd9946bb8152ef8a21fe.zip
mg: Fix gain setting on channels 1 and 3
Updated channel param: -modify radio_ctrl_cpld the param for channel has to be more concrete type of chan_sel_t -fix _update_rx_freq_switches and _update_tx_freq_switches to get correct frequency by NOT using radio base class
Diffstat (limited to 'host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_gain.cpp')
-rw-r--r--host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_gain.cpp12
1 files changed, 7 insertions, 5 deletions
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 a8eb7c6fb..d7869a24a 100644
--- a/host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_gain.cpp
+++ b/host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_gain.cpp
@@ -25,7 +25,9 @@ double magnesium_radio_ctrl_impl::_set_all_gain(
"freq=" << freq << " Hz, "
"chan=" << chan << ", "
"dir=" << dir);
- size_t ad9371_chan = _master?0:1;
+ const size_t ad9371_chan = _master ? 0 : 1; ;// FIXME: use chan when 2 radios
+ magnesium_cpld_ctrl::chan_sel_t chan_sel =
+ _master ? magnesium_cpld_ctrl::CHAN1 : magnesium_cpld_ctrl::CHAN2;
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)
@@ -41,18 +43,18 @@ double magnesium_radio_ctrl_impl::_set_all_gain(
_all_rx_gain = gain;
_rx_bypass_lnas = gain_tuple.bypass;
_update_rx_freq_switches(
- radio_ctrl_impl::get_rx_frequency(chan),
+ this->get_rx_frequency(chan),
_rx_bypass_lnas,
- chan
+ chan_sel
);
}
if (dir == TX_DIRECTION or dir == DX_DIRECTION) {
_all_tx_gain = gain;
_tx_bypass_amp = gain_tuple.bypass;
_update_tx_freq_switches(
- radio_ctrl_impl::get_tx_frequency(chan),
+ this->get_tx_frequency(chan),
_tx_bypass_amp,
- chan
+ chan_sel
);
}