From 3665242c33f0c8ca6fd7059d596e4c7976242858 Mon Sep 17 00:00:00 2001 From: Mark Meserve Date: Tue, 19 Feb 2019 18:20:48 -0600 Subject: uhd: set tx gain to max for rx iq cal - The other cal utilities (TX IQ and TX DC) already do this. - This fixes calibration for certain frequencies on N320/N321. - Old calibration data is still valid after this change. --- host/utils/uhd_cal_rx_iq_balance.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/host/utils/uhd_cal_rx_iq_balance.cpp b/host/utils/uhd_cal_rx_iq_balance.cpp index a90e37651..c68c96173 100644 --- a/host/utils/uhd_cal_rx_iq_balance.cpp +++ b/host/utils/uhd_cal_rx_iq_balance.cpp @@ -28,10 +28,15 @@ namespace po = boost::program_options; /*********************************************************************** * Transmit thread **********************************************************************/ -static void tx_thread(uhd::tx_streamer::sptr tx_stream, const double tx_wave_ampl) +static void tx_thread(uhd::usrp::multi_usrp::sptr usrp, + uhd::tx_streamer::sptr tx_stream, + const double tx_wave_ampl) { uhd::set_thread_priority_safe(); + // set max TX gain + usrp->set_tx_gain(usrp->get_tx_gain_range().stop()); + // setup variables and allocate buffer uhd::tx_metadata_t md; md.has_time_spec = false; @@ -139,7 +144,7 @@ int UHD_SAFE_MAIN(int argc, char* argv[]) // create a transmitter thread boost::thread_group threads; - threads.create_thread(boost::bind(&tx_thread, tx_stream, tx_wave_ampl)); + threads.create_thread(boost::bind(&tx_thread, usrp, tx_stream, tx_wave_ampl)); // re-usable buffer for samples std::vector buff; -- cgit v1.2.3