diff options
author | Josh Blum <josh@joshknows.com> | 2010-08-15 22:23:04 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2010-08-15 22:23:04 -0700 |
commit | a80a62dfe6ebfe5a814c71880b83b64a6bee0d0a (patch) | |
tree | a8d8e6105ad54608883e85f0e2e17ffeb99089fe /host/lib/usrp/misc_utils.cpp | |
parent | 58519b292b561cbec5eb41c85f85c8c6bd4a06fe (diff) | |
download | uhd-a80a62dfe6ebfe5a814c71880b83b64a6bee0d0a.tar.gz uhd-a80a62dfe6ebfe5a814c71880b83b64a6bee0d0a.tar.bz2 uhd-a80a62dfe6ebfe5a814c71880b83b64a6bee0d0a.zip |
usrp: use different priority policies for gain group (rx vs tx)
Diffstat (limited to 'host/lib/usrp/misc_utils.cpp')
-rw-r--r-- | host/lib/usrp/misc_utils.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/host/lib/usrp/misc_utils.cpp b/host/lib/usrp/misc_utils.cpp index 41239b144..46094ba32 100644 --- a/host/lib/usrp/misc_utils.cpp +++ b/host/lib/usrp/misc_utils.cpp @@ -29,9 +29,6 @@ using namespace uhd; using namespace uhd::usrp; -static const size_t subdev_gain_priority = 1; //higher, closer to the antenna -static const size_t codec_gain_priority = 0; - /*********************************************************************** * codec gain group helper functions: * do this so we dont have to bind a templated function @@ -80,7 +77,15 @@ 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(wax::obj subdev, wax::obj codec){ +gain_group::sptr usrp::make_gain_group( + wax::obj subdev, wax::obj codec, + gain_group_policy_t gain_group_policy +){ + const size_t subdev_gain_priority = 1; + 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) + gain_group::sptr gg = gain_group::make(); gain_fcns_t fcns; //add all the subdev gains first (antenna to dsp order) |