aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/dboard/rhodium/rhodium_radio_ctrl_impl.cpp
diff options
context:
space:
mode:
authorMark Meserve <mark.meserve@ni.com>2018-10-15 15:03:48 -0500
committerBrent Stapleton <bstapleton@g.hmc.edu>2018-11-01 11:58:20 -0700
commit44eb4b4b43a58324854ce50ef983331c98125eeb (patch)
treea02f01ee0d052ff67af5e98e952f504e0435b6d7 /host/lib/usrp/dboard/rhodium/rhodium_radio_ctrl_impl.cpp
parent09136828d4b1b6c9123651f9e2e1894ada436038 (diff)
downloaduhd-44eb4b4b43a58324854ce50ef983331c98125eeb.tar.gz
uhd-44eb4b4b43a58324854ce50ef983331c98125eeb.tar.bz2
uhd-44eb4b4b43a58324854ce50ef983331c98125eeb.zip
rh: fix handling of spur_dodging arg
Diffstat (limited to 'host/lib/usrp/dboard/rhodium/rhodium_radio_ctrl_impl.cpp')
-rw-r--r--host/lib/usrp/dboard/rhodium/rhodium_radio_ctrl_impl.cpp22
1 files changed, 15 insertions, 7 deletions
diff --git a/host/lib/usrp/dboard/rhodium/rhodium_radio_ctrl_impl.cpp b/host/lib/usrp/dboard/rhodium/rhodium_radio_ctrl_impl.cpp
index b9c56a7f0..01f467476 100644
--- a/host/lib/usrp/dboard/rhodium/rhodium_radio_ctrl_impl.cpp
+++ b/host/lib/usrp/dboard/rhodium/rhodium_radio_ctrl_impl.cpp
@@ -309,19 +309,23 @@ uhd::gain_range_t rhodium_radio_ctrl_impl::_get_gain_range(direction_t dir)
bool rhodium_radio_ctrl_impl::_get_spur_dodging_enabled(uhd::direction_t dir) const
{
+ UHD_ASSERT_THROW(_tree->exists(get_arg_path(SPUR_DODGING_ARG_NAME) / "value"));
+ auto block_value = _tree->access<std::string>(get_arg_path(SPUR_DODGING_ARG_NAME) / "value").get();
auto dict = _get_tune_args(_tree, _radio_slot, dir);
// get the current tune_arg for spur_dodging
- // if the tune_arg doesn't exist, get the radio block argument instead
+ // if the tune_arg doesn't exist, use the radio block argument instead
std::string spur_dodging_arg = dict.cast<std::string>(
- "spur_dodging",
- (_tree->access<std::string>(get_arg_path("spur_dodging") / "value").get()));
+ SPUR_DODGING_ARG_NAME,
+ block_value);
if (spur_dodging_arg == "enabled")
{
+ UHD_LOG_TRACE(unique_id(), "_get_spur_dodging_enabled returning enabled");
return true;
}
else if (spur_dodging_arg == "disabled") {
+ UHD_LOG_TRACE(unique_id(), "_get_spur_dodging_enabled returning disabled");
return false;
}
else {
@@ -333,13 +337,17 @@ bool rhodium_radio_ctrl_impl::_get_spur_dodging_enabled(uhd::direction_t dir) co
double rhodium_radio_ctrl_impl::_get_spur_dodging_threshold(uhd::direction_t dir) const
{
+ UHD_ASSERT_THROW(_tree->exists(get_arg_path(SPUR_DODGING_THRESHOLD_ARG_NAME) / "value"));
+ auto block_value = _tree->access<double>(get_arg_path(SPUR_DODGING_THRESHOLD_ARG_NAME) / "value").get();
auto dict = _get_tune_args(_tree, _radio_slot, dir);
// get the current tune_arg for spur_dodging_threshold
- // if the tune_arg doesn't exist, get the radio block argument instead
- return dict.cast(
- "spur_dodging_threshold",
- _tree->access<double>(get_arg_path("spur_dodging_threshold") / "value").get());
+ // if the tune_arg doesn't exist, use the radio block argument instead
+ auto threshold = dict.cast<double>(SPUR_DODGING_THRESHOLD_ARG_NAME, block_value);
+
+ UHD_LOG_TRACE(unique_id(), "_get_spur_dodging_threshold returning " << threshold);
+
+ return threshold;
}
size_t rhodium_radio_ctrl_impl::get_chan_from_dboard_fe(