aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/common/ad936x_manager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'host/lib/usrp/common/ad936x_manager.cpp')
-rw-r--r--host/lib/usrp/common/ad936x_manager.cpp21
1 files changed, 10 insertions, 11 deletions
diff --git a/host/lib/usrp/common/ad936x_manager.cpp b/host/lib/usrp/common/ad936x_manager.cpp
index 2b6d69c15..503678554 100644
--- a/host/lib/usrp/common/ad936x_manager.cpp
+++ b/host/lib/usrp/common/ad936x_manager.cpp
@@ -16,8 +16,7 @@
//
#include "ad936x_manager.hpp"
-#include <uhd/utils/msg.hpp>
-#include <boost/foreach.hpp>
+#include <uhd/utils/log.hpp>
#include <boost/functional/hash.hpp>
#include <boost/thread/thread.hpp>
@@ -66,7 +65,7 @@ class ad936x_manager_impl : public ad936x_manager
***********************************************************************/
void init_codec()
{
- BOOST_FOREACH(const std::string &rx_fe, _rx_frontends) {
+ for(const std::string &rx_fe: _rx_frontends) {
_codec_ctrl->set_gain(rx_fe, DEFAULT_GAIN);
_codec_ctrl->set_bw_filter(rx_fe, DEFAULT_BANDWIDTH);
_codec_ctrl->tune(rx_fe, DEFAULT_FREQ);
@@ -74,7 +73,7 @@ class ad936x_manager_impl : public ad936x_manager
_codec_ctrl->set_iq_balance_auto(rx_fe, DEFAULT_AUTO_IQ_BALANCE);
_codec_ctrl->set_agc(rx_fe, DEFAULT_AGC_ENABLE);
}
- BOOST_FOREACH(const std::string &tx_fe, _tx_frontends) {
+ for(const std::string &tx_fe: _tx_frontends) {
_codec_ctrl->set_gain(tx_fe, DEFAULT_GAIN);
_codec_ctrl->set_bw_filter(tx_fe, DEFAULT_BANDWIDTH);
_codec_ctrl->tune(tx_fe, DEFAULT_FREQ);
@@ -98,7 +97,7 @@ class ad936x_manager_impl : public ad936x_manager
) {
// Put AD936x in loopback mode
_codec_ctrl->data_port_loopback(true);
- UHD_MSG(status) << "Performing CODEC loopback test... " << std::flush;
+ UHD_LOGGER_INFO("AD936X") << "Performing CODEC loopback test... ";
size_t hash = size_t(time(NULL));
// Allow some time for AD936x to enter loopback mode.
@@ -127,11 +126,11 @@ class ad936x_manager_impl : public ad936x_manager
bool test_fail = word32 != rb_tx or word32 != rb_rx;
if(test_fail)
{
- UHD_MSG(status) << "fail" << std::endl;
+ UHD_LOGGER_INFO("AD936X") << "CODEC loopback test failed";
throw uhd::runtime_error("CODEC loopback test failed.");
}
}
- UHD_MSG(status) << "pass" << std::endl;
+ UHD_LOGGER_INFO("AD936X") << "CODEC loopback test passed";
// Zero out the idle data.
poker_functor(0);
@@ -194,10 +193,10 @@ class ad936x_manager_impl : public ad936x_manager
bool check_bandwidth(double rate, const std::string dir)
{
if (rate > _codec_ctrl->get_bw_filter_range(dir).stop()) {
- UHD_MSG(warning)
+ UHD_LOGGER_WARNING("AD936X")
<< "Selected " << dir << " bandwidth (" << (rate/1e6) << " MHz) exceeds\n"
<< "analog frontend filter bandwidth (" << (_codec_ctrl->get_bw_filter_range(dir).stop()/1e6) << " MHz)."
- << std::endl;
+ ;
return false;
}
return true;
@@ -218,7 +217,7 @@ class ad936x_manager_impl : public ad936x_manager
}
// Gains
- BOOST_FOREACH(const std::string &name, ad9361_ctrl::get_gain_names(key))
+ for(const std::string &name: ad9361_ctrl::get_gain_names(key))
{
subtree->create<meta_range_t>(uhd::fs_path("gains") / name / "range")
.set(ad9361_ctrl::get_gain_range(key));
@@ -278,7 +277,7 @@ class ad936x_manager_impl : public ad936x_manager
}
// Frontend filters
- BOOST_FOREACH(const std::string &filter_name, _codec_ctrl->get_filter_names(key)) {
+ for(const std::string &filter_name: _codec_ctrl->get_filter_names(key)) {
subtree->create<filter_info_base::sptr>(uhd::fs_path("filters") / filter_name / "value" )
.set_publisher(boost::bind(&ad9361_ctrl::get_filter, _codec_ctrl, key, filter_name))
.add_coerced_subscriber(boost::bind(&ad9361_ctrl::set_filter, _codec_ctrl, key, filter_name, _1));