aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/misc_utils.cpp
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-10-21 15:29:03 -0700
committerJosh Blum <josh@joshknows.com>2010-10-21 15:29:03 -0700
commit1e57eec9999e1a9d0a735c04173c78164ce8afcd (patch)
treee34b3e52fe4c7a34a6588e15efbb8416b29d81b5 /host/lib/usrp/misc_utils.cpp
parent5bf9e60baf7b85db3da0d41b97d9fe4e9b3e64bd (diff)
parente2f76bddae7845024056b479658651c6da2b0f4d (diff)
downloaduhd-1e57eec9999e1a9d0a735c04173c78164ce8afcd.tar.gz
uhd-1e57eec9999e1a9d0a735c04173c78164ce8afcd.tar.bz2
uhd-1e57eec9999e1a9d0a735c04173c78164ce8afcd.zip
Merge branch 'master' into flow_ctrl
Diffstat (limited to 'host/lib/usrp/misc_utils.cpp')
-rw-r--r--host/lib/usrp/misc_utils.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/host/lib/usrp/misc_utils.cpp b/host/lib/usrp/misc_utils.cpp
index 05308baba..7e49baa52 100644
--- a/host/lib/usrp/misc_utils.cpp
+++ b/host/lib/usrp/misc_utils.cpp
@@ -80,6 +80,7 @@ static void set_subdev_gain(wax::obj subdev, const std::string &name, float gain
* gain group factory function for usrp
**********************************************************************/
gain_group::sptr usrp::make_gain_group(
+ const dboard_id_t &dboard_id,
wax::obj subdev, wax::obj codec,
gain_group_policy_t gain_group_policy
){
@@ -87,6 +88,8 @@ gain_group::sptr usrp::make_gain_group(
const size_t codec_gain_priority = (gain_group_policy == GAIN_GROUP_POLICY_RX)?
(subdev_gain_priority - 1): //RX policy, codec gains fill last (lower priority)
(subdev_gain_priority + 1); //TX policy, codec gains fill first (higher priority)
+ const std::string subdev_prefix = dboard_id.to_cname() + "-";
+ const std::string codec_prefix = (gain_group_policy == GAIN_GROUP_POLICY_RX)? "ADC-" : "DAC-";
gain_group::sptr gg = gain_group::make();
gain_fcns_t fcns;
@@ -95,7 +98,7 @@ gain_group::sptr usrp::make_gain_group(
fcns.get_range = boost::bind(&get_subdev_gain_range, subdev, name);
fcns.get_value = boost::bind(&get_subdev_gain, subdev, name);
fcns.set_value = boost::bind(&set_subdev_gain, subdev, name, _1);
- gg->register_fcns(fcns, subdev_gain_priority);
+ gg->register_fcns(subdev_prefix+name, fcns, subdev_gain_priority);
}
//add all the codec gains last (antenna to dsp order)
BOOST_FOREACH(const std::string &name, codec[CODEC_PROP_GAIN_NAMES].as<prop_names_t>()){
@@ -119,7 +122,7 @@ gain_group::sptr usrp::make_gain_group(
fcns.set_value = boost::bind(&set_codec_gain_q, codec, name, _1);
break;
}
- gg->register_fcns(fcns, codec_gain_priority);
+ gg->register_fcns(codec_prefix+name, fcns, codec_gain_priority);
}
return gg;
}