aboutsummaryrefslogtreecommitdiffstats
path: root/host/utils/uhd_cal_tx_iq_balance.cpp
diff options
context:
space:
mode:
authorBen Hilburn <ben.hilburn@ettus.com>2014-04-10 13:10:03 -0700
committerBen Hilburn <ben.hilburn@ettus.com>2014-04-10 13:10:03 -0700
commit3b2246a46d12c6ca0eaf4c9aeaae0e5060ed6004 (patch)
tree5d45abfd51cc47519c83f5665095320d9ce8336c /host/utils/uhd_cal_tx_iq_balance.cpp
parent21518ec2baf0026966e11f35400a75c98d625a7f (diff)
parent7cb3c980f92847f1c03df21f28f6deb1ec827792 (diff)
downloaduhd-3b2246a46d12c6ca0eaf4c9aeaae0e5060ed6004.tar.gz
uhd-3b2246a46d12c6ca0eaf4c9aeaae0e5060ed6004.tar.bz2
uhd-3b2246a46d12c6ca0eaf4c9aeaae0e5060ed6004.zip
Merge branch 'origin/uhd/cal_tools_subdev_B'
Fixing issue with subdev selection in cal tools.
Diffstat (limited to 'host/utils/uhd_cal_tx_iq_balance.cpp')
-rw-r--r--host/utils/uhd_cal_tx_iq_balance.cpp33
1 files changed, 2 insertions, 31 deletions
diff --git a/host/utils/uhd_cal_tx_iq_balance.cpp b/host/utils/uhd_cal_tx_iq_balance.cpp
index 786aac061..4259c6df4 100644
--- a/host/utils/uhd_cal_tx_iq_balance.cpp
+++ b/host/utils/uhd_cal_tx_iq_balance.cpp
@@ -18,12 +18,7 @@
#include "usrp_cal_utils.hpp"
#include <uhd/utils/thread_priority.hpp>
#include <uhd/utils/safe_main.hpp>
-#include <uhd/utils/paths.hpp>
-#include <uhd/utils/algorithm.hpp>
-#include <uhd/utils/msg.hpp>
-#include <uhd/usrp/multi_usrp.hpp>
#include <boost/program_options.hpp>
-#include <boost/format.hpp>
#include <boost/thread/thread.hpp>
#include <boost/math/special_functions/round.hpp>
#include <iostream>
@@ -129,32 +124,8 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
return EXIT_FAILURE;
}
- //create a usrp device
- std::cout << std::endl;
- std::cout << boost::format("Creating the usrp device with: %s...") % args << std::endl;
- uhd::usrp::multi_usrp::sptr usrp = uhd::usrp::multi_usrp::make(args);
-
- // Configure subdev
- if (vm.count("subdev")) {
- usrp->set_tx_subdev_spec(subdev);
- usrp->set_rx_subdev_spec(subdev);
- }
- UHD_MSG(status) << "Running calibration for " << usrp->get_tx_subdev_name(0) << std::endl;
- serial = get_serial(usrp, "tx");
- UHD_MSG(status) << "Daughterboard serial: " << serial << std::endl;
-
- //set the antennas to cal
- if (not uhd::has(usrp->get_rx_antennas(), "CAL") or not uhd::has(usrp->get_tx_antennas(), "CAL")){
- throw std::runtime_error("This board does not have the CAL antenna option, cannot self-calibrate.");
- }
- usrp->set_rx_antenna("CAL");
- usrp->set_tx_antenna("CAL");
-
- //fail if daughterboard has no serial
- check_for_empty_serial(usrp, "TX", "tx", args);
-
- //set optimum defaults
- set_optimum_defaults(usrp);
+ // Create a USRP device
+ uhd::usrp::multi_usrp::sptr usrp = setup_usrp_for_cal(args, subdev, serial);
//create a receive streamer
uhd::stream_args_t stream_args("fc32"); //complex floats