aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/dboard/db_ubx.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'host/lib/usrp/dboard/db_ubx.cpp')
-rw-r--r--host/lib/usrp/dboard/db_ubx.cpp40
1 files changed, 22 insertions, 18 deletions
diff --git a/host/lib/usrp/dboard/db_ubx.cpp b/host/lib/usrp/dboard/db_ubx.cpp
index d9abef599..b4cceac7a 100644
--- a/host/lib/usrp/dboard/db_ubx.cpp
+++ b/host/lib/usrp/dboard/db_ubx.cpp
@@ -27,7 +27,7 @@
#include <uhd/usrp/dboard_manager.hpp>
#include <uhd/utils/assert_has.hpp>
#include <uhd/utils/log.hpp>
-#include <uhd/utils/msg.hpp>
+
#include <uhd/utils/static.hpp>
#include <uhd/utils/safe_call.hpp>
#include <boost/assign/list_of.hpp>
@@ -301,7 +301,7 @@ public:
{
std::vector<double> rates = _iface->get_clock_rates(dboard_iface::UNIT_RX);
double highest_rate = 0.0;
- BOOST_FOREACH(double rate, rates)
+ for(double rate: rates)
{
if (rate <= pfd_freq_max and rate > highest_rate)
highest_rate = rate;
@@ -309,7 +309,9 @@ public:
try {
_iface->set_clock_rate(dboard_iface::UNIT_RX, highest_rate);
} catch (const uhd::not_implemented_error &) {
- UHD_MSG(warning) << "Unable to set dboard clock rate - phase will vary" << std::endl;
+ UHD_LOG_WARNING("UBX",
+ "Unable to set dboard clock rate - phase will vary"
+ );
can_set_clock_rate = false;
}
_rx_target_pfd_freq = highest_rate;
@@ -318,7 +320,7 @@ public:
{
std::vector<double> rates = _iface->get_clock_rates(dboard_iface::UNIT_TX);
double highest_rate = 0.0;
- BOOST_FOREACH(double rate, rates)
+ for(double rate: rates)
{
if (rate <= pfd_freq_max and rate > highest_rate)
highest_rate = rate;
@@ -326,7 +328,9 @@ public:
try {
_iface->set_clock_rate(dboard_iface::UNIT_TX, highest_rate);
} catch (const uhd::not_implemented_error &) {
- UHD_MSG(warning) << "Unable to set dboard clock rate - phase will vary" << std::endl;
+ UHD_LOG_WARNING("UBX",
+ "Unable to set dboard clock rate - phase will vary"
+ );
}
_tx_target_pfd_freq = highest_rate;
}
@@ -380,7 +384,7 @@ public:
_rxlo1 = max287x_iface::make<max2870>(boost::bind(&ubx_xcvr::write_spi_regs, this, RXLO1, _1));
_rxlo2 = max287x_iface::make<max2870>(boost::bind(&ubx_xcvr::write_spi_regs, this, RXLO2, _1));
std::vector<max287x_iface::sptr> los = boost::assign::list_of(_txlo1)(_txlo2)(_rxlo1)(_rxlo2);
- BOOST_FOREACH(max287x_iface::sptr lo, los)
+ for(max287x_iface::sptr lo: los)
{
lo->set_auto_retune(false);
lo->set_muxout_mode(max287x_iface::MUXOUT_DLD);
@@ -394,7 +398,7 @@ public:
_rxlo1 = max287x_iface::make<max2871>(boost::bind(&ubx_xcvr::write_spi_regs, this, RXLO1, _1));
_rxlo2 = max287x_iface::make<max2871>(boost::bind(&ubx_xcvr::write_spi_regs, this, RXLO2, _1));
std::vector<max287x_iface::sptr> los = boost::assign::list_of(_txlo1)(_txlo2)(_rxlo1)(_rxlo2);
- BOOST_FOREACH(max287x_iface::sptr lo, los)
+ for(max287x_iface::sptr lo: los)
{
lo->set_auto_retune(false);
//lo->set_cycle_slip_mode(true); // tried it - caused longer lock times
@@ -557,7 +561,7 @@ private:
{
boost::mutex::scoped_lock lock(_spi_mutex);
ROUTE_SPI(_iface, dest);
- BOOST_FOREACH(uint32_t value, values)
+ for(uint32_t value: values)
WRITE_SPI(_iface, value);
}
@@ -759,7 +763,7 @@ private:
_ubx_tx_atten_val = ((attn_code & 0x3F) << 10);
set_gpio_field(TX_GAIN, attn_code);
write_gpio();
- UHD_LOGV(rarely) << boost::format("UBX TX Gain: %f dB, Code: %d, IO Bits 0x%04x") % gain % attn_code % _ubx_tx_atten_val << std::endl;
+ UHD_LOGGER_TRACE("UBX") << boost::format("UBX TX Gain: %f dB, Code: %d, IO Bits 0x%04x") % gain % attn_code % _ubx_tx_atten_val ;
_tx_gain = gain;
return gain;
}
@@ -772,7 +776,7 @@ private:
_ubx_rx_atten_val = ((attn_code & 0x3F) << 10);
set_gpio_field(RX_GAIN, attn_code);
write_gpio();
- UHD_LOGV(rarely) << boost::format("UBX RX Gain: %f dB, Code: %d, IO Bits 0x%04x") % gain % attn_code % _ubx_rx_atten_val << std::endl;
+ UHD_LOGGER_TRACE("UBX") << boost::format("UBX RX Gain: %f dB, Code: %d, IO Bits 0x%04x") % gain % attn_code % _ubx_rx_atten_val ;
_rx_gain = gain;
return gain;
}
@@ -796,18 +800,18 @@ private:
property_tree::sptr subtree = this->get_tx_subtree();
device_addr_t tune_args = subtree->access<device_addr_t>("tune_args").get();
is_int_n = boost::iequals(tune_args.get("mode_n",""), "integer");
- UHD_LOGV(rarely) << boost::format("UBX TX: the requested frequency is %f MHz") % (freq/1e6) << std::endl;
+ UHD_LOGGER_TRACE("UBX") << boost::format("UBX TX: the requested frequency is %f MHz") % (freq/1e6) ;
double target_pfd_freq = _tx_target_pfd_freq;
if (is_int_n and tune_args.has_key("int_n_step"))
{
target_pfd_freq = tune_args.cast<double>("int_n_step", _tx_target_pfd_freq);
if (target_pfd_freq > _tx_target_pfd_freq)
{
- UHD_MSG(warning)
+ UHD_LOGGER_WARNING("UBX")
<< boost::format("Requested int_n_step of %f MHz too large, clipping to %f MHz")
% (target_pfd_freq/1e6)
% (_tx_target_pfd_freq/1e6)
- << std::endl;
+ ;
target_pfd_freq = _tx_target_pfd_freq;
}
}
@@ -935,7 +939,7 @@ private:
_txlo1_freq = freq_lo1;
_txlo2_freq = freq_lo2;
- UHD_LOGV(rarely) << boost::format("UBX TX: the actual frequency is %f MHz") % (_tx_freq/1e6) << std::endl;
+ UHD_LOGGER_TRACE("UBX") << boost::format("UBX TX: the actual frequency is %f MHz") % (_tx_freq/1e6) ;
return _tx_freq;
}
@@ -948,7 +952,7 @@ private:
double ref_freq = _iface->get_clock_rate(dboard_iface::UNIT_RX);
bool is_int_n = false;
- UHD_LOGV(rarely) << boost::format("UBX RX: the requested frequency is %f MHz") % (freq/1e6) << std::endl;
+ UHD_LOGGER_TRACE("UBX") << boost::format("UBX RX: the requested frequency is %f MHz") % (freq/1e6) ;
property_tree::sptr subtree = this->get_rx_subtree();
device_addr_t tune_args = subtree->access<device_addr_t>("tune_args").get();
@@ -959,11 +963,11 @@ private:
target_pfd_freq = tune_args.cast<double>("int_n_step", _rx_target_pfd_freq);
if (target_pfd_freq > _rx_target_pfd_freq)
{
- UHD_MSG(warning)
+ UHD_LOGGER_WARNING("UBX")
<< boost::format("Requested int_n_step of %f Mhz too large, clipping to %f MHz")
% (target_pfd_freq/1e6)
% (_rx_target_pfd_freq/1e6)
- << std::endl;
+ ;
target_pfd_freq = _rx_target_pfd_freq;
}
}
@@ -1131,7 +1135,7 @@ private:
_rxlo1_freq = freq_lo1;
_rxlo2_freq = freq_lo2;
- UHD_LOGV(rarely) << boost::format("UBX RX: the actual frequency is %f MHz") % (_rx_freq/1e6) << std::endl;
+ UHD_LOGGER_TRACE("UBX") << boost::format("UBX RX: the actual frequency is %f MHz") % (_rx_freq/1e6) ;
return _rx_freq;
}