aboutsummaryrefslogtreecommitdiffstats
path: root/host/utils/uhd_cal_tx_dc_offset.cpp
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2014-04-01 15:45:56 +0200
committerMartin Braun <martin.braun@ettus.com>2014-04-10 21:38:14 +0200
commit7cb3c980f92847f1c03df21f28f6deb1ec827792 (patch)
tree9c3b0f7969a1d11279c85838e461dedd56fca80f /host/utils/uhd_cal_tx_dc_offset.cpp
parent2ca6575ff390caf74702c5f3b92fa5a1e09d5414 (diff)
downloaduhd-7cb3c980f92847f1c03df21f28f6deb1ec827792.tar.gz
uhd-7cb3c980f92847f1c03df21f28f6deb1ec827792.tar.bz2
uhd-7cb3c980f92847f1c03df21f28f6deb1ec827792.zip
uhd: Fixed bug in cal tools that would always use A-side settings, also some refactoring
Diffstat (limited to 'host/utils/uhd_cal_tx_dc_offset.cpp')
-rw-r--r--host/utils/uhd_cal_tx_dc_offset.cpp28
1 files changed, 2 insertions, 26 deletions
diff --git a/host/utils/uhd_cal_tx_dc_offset.cpp b/host/utils/uhd_cal_tx_dc_offset.cpp
index eb82db826..798571ad5 100644
--- a/host/utils/uhd_cal_tx_dc_offset.cpp
+++ b/host/utils/uhd_cal_tx_dc_offset.cpp
@@ -128,32 +128,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