From 7ad64600fe3db643ba10a88990263b13dac7d063 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Thu, 26 Mar 2020 10:55:31 -0700 Subject: utils: cal: Enable "ignore cal file" option for DC and IQ cal tools The utilities uhd_cal_rx_iq_balance, uhd_cal_tx_iq_balance, and uhd_cal_tx_dc_offset now add the flags to ignore cal files. Otherwise, the utility would load existing cal data before generating new cal data. Note that this is not a huge problem, because the cal coefficients get overwritten during the cal process, but is unnecessary disk I/O. This commit also happens to remove all boost::format uses within usrp_cal_utils.hpp. --- host/utils/usrp_cal_utils.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'host/utils') diff --git a/host/utils/usrp_cal_utils.hpp b/host/utils/usrp_cal_utils.hpp index d43df7a1b..941c57e5f 100644 --- a/host/utils/usrp_cal_utils.hpp +++ b/host/utils/usrp_cal_utils.hpp @@ -13,7 +13,6 @@ #include #include #include -#include #include #include #include @@ -223,7 +222,7 @@ static void capture_samples(uhd::usrp::multi_usrp::sptr usrp, rx_stream->recv(&discard_buff.front(), discard_buff.size(), md); if (md.error_code != uhd::rx_metadata_t::ERROR_CODE_NONE) { throw std::runtime_error( - str(boost::format("Receiver error: %s") % md.strerror())); + std::string("Receiver error: ") + md.strerror()); } // Now capture the data we want @@ -232,7 +231,7 @@ static void capture_samples(uhd::usrp::multi_usrp::sptr usrp, // validate the received data if (md.error_code != uhd::rx_metadata_t::ERROR_CODE_NONE) { throw std::runtime_error( - str(boost::format("Receiver error: %s") % md.strerror())); + std::string("Receiver error: ") + md.strerror()); } // we can live if all the data didnt come in @@ -250,10 +249,11 @@ static void capture_samples(uhd::usrp::multi_usrp::sptr usrp, static uhd::usrp::multi_usrp::sptr setup_usrp_for_cal( std::string& args, std::string& subdev, std::string& serial) { + const std::string args_with_ignore = args + ",ignore_cal_file=1,ignore-cal-file=1"; std::cout << std::endl; - std::cout << boost::format("Creating the usrp device with: %s...") % args + std::cout << "Creating the usrp device with: " << args_with_ignore << "..." << std::endl; - uhd::usrp::multi_usrp::sptr usrp = uhd::usrp::multi_usrp::make(args); + uhd::usrp::multi_usrp::sptr usrp = uhd::usrp::multi_usrp::make(args_with_ignore); // Configure subdev if (!subdev.empty()) { -- cgit v1.2.3