From 44eb4b4b43a58324854ce50ef983331c98125eeb Mon Sep 17 00:00:00 2001 From: Mark Meserve Date: Mon, 15 Oct 2018 15:03:48 -0500 Subject: rh: fix handling of spur_dodging arg --- .../dboard/rhodium/rhodium_radio_ctrl_impl.cpp | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'host/lib/usrp/dboard/rhodium/rhodium_radio_ctrl_impl.cpp') 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(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( - "spur_dodging", - (_tree->access(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(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(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(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( -- cgit v1.2.3