diff options
author | Josh Blum <josh@joshknows.com> | 2010-08-15 23:21:43 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2010-08-15 23:21:43 -0700 |
commit | 963f60c69c25a1295b5ed4dee07df5d91567deb7 (patch) | |
tree | 0fa0d0e281a8cf17f3b222e1b2226fb45c16fa27 /host/lib/usrp/misc_utils.cpp | |
parent | e7d4233a94571a2479b21bc081567214c38cc155 (diff) | |
parent | f75869e4f7ffb53ca7f348c3a1b6d6c8fb1499b7 (diff) | |
download | uhd-963f60c69c25a1295b5ed4dee07df5d91567deb7.tar.gz uhd-963f60c69c25a1295b5ed4dee07df5d91567deb7.tar.bz2 uhd-963f60c69c25a1295b5ed4dee07df5d91567deb7.zip |
Merge branch 'next' into usrp1_next
Diffstat (limited to 'host/lib/usrp/misc_utils.cpp')
-rw-r--r-- | host/lib/usrp/misc_utils.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/host/lib/usrp/misc_utils.cpp b/host/lib/usrp/misc_utils.cpp index 930314fc2..46094ba32 100644 --- a/host/lib/usrp/misc_utils.cpp +++ b/host/lib/usrp/misc_utils.cpp @@ -15,7 +15,7 @@ // along with this program. If not, see <http://www.gnu.org/licenses/>. // -#include "misc_utils.hpp" +#include <uhd/usrp/misc_utils.hpp> #include <uhd/utils/assert.hpp> #include <uhd/utils/gain_group.hpp> #include <uhd/usrp/dboard_id.hpp> @@ -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) |