aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2020-03-26 10:55:31 -0700
committerAaron Rossetto <aaron.rossetto@ni.com>2020-04-02 11:55:17 -0500
commit7ad64600fe3db643ba10a88990263b13dac7d063 (patch)
treeaa8e0357061e4cabcb29550c79dddba344e9289a
parent0221d3fdf8998f5d4f985c4fb5a126f41fbd2706 (diff)
downloaduhd-7ad64600fe3db643ba10a88990263b13dac7d063.tar.gz
uhd-7ad64600fe3db643ba10a88990263b13dac7d063.tar.bz2
uhd-7ad64600fe3db643ba10a88990263b13dac7d063.zip
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.
-rw-r--r--host/utils/usrp_cal_utils.hpp10
1 files changed, 5 insertions, 5 deletions
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 <uhd/utils/algorithm.hpp>
#include <uhd/utils/paths.hpp>
#include <boost/filesystem.hpp>
-#include <boost/format.hpp>
#include <chrono>
#include <cmath>
#include <complex>
@@ -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()) {