diff options
author | Josh Blum <josh@joshknows.com> | 2010-11-11 17:40:01 -0800 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2010-11-11 17:40:01 -0800 |
commit | 476afe68f5c37a3e10a1208b0150732d7770a023 (patch) | |
tree | 73ea72533375d32ac35bcfff578ac0d774a89343 /host/lib/usrp/usrp2/codec_impl.cpp | |
parent | 478f8174601350ad0edd52bb985657037b181a2d (diff) | |
download | uhd-476afe68f5c37a3e10a1208b0150732d7770a023.tar.gz uhd-476afe68f5c37a3e10a1208b0150732d7770a023.tar.bz2 uhd-476afe68f5c37a3e10a1208b0150732d7770a023.zip |
usrp2: made enums for the rev types and implemented in code
Diffstat (limited to 'host/lib/usrp/usrp2/codec_impl.cpp')
-rw-r--r-- | host/lib/usrp/usrp2/codec_impl.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/host/lib/usrp/usrp2/codec_impl.cpp b/host/lib/usrp/usrp2/codec_impl.cpp index 1c1f60765..5f4937643 100644 --- a/host/lib/usrp/usrp2/codec_impl.cpp +++ b/host/lib/usrp/usrp2/codec_impl.cpp @@ -32,7 +32,7 @@ using namespace boost::assign; static const uhd::dict<std::string, gain_range_t> codec_rx_gain_ranges = map_list_of ("analog", gain_range_t(0, 3.5, 3.5)) ("digital", gain_range_t(0, 6.0, 0.5)) - ("digital-fine", gain_range_t(0, 0.5, 0.05)); + ("digital-fine", gain_range_t(0, 0.5, 0.05)); /*********************************************************************** @@ -67,9 +67,14 @@ void usrp2_mboard_impl::rx_codec_get(const wax::obj &key_, wax::obj &val){ return; case CODEC_PROP_GAIN_NAMES: - if(_iface->is_usrp2p()) { - val = prop_names_t(codec_rx_gain_ranges.keys()); - } else val = prop_names_t(); + switch(_iface->get_rev()){ + case usrp2_iface::USRP_N200: + case usrp2_iface::USRP_N210: + val = prop_names_t(codec_rx_gain_ranges.keys()); + return; + + default: val = prop_names_t(); + } return; case CODEC_PROP_GAIN_I: @@ -89,19 +94,14 @@ void usrp2_mboard_impl::rx_codec_get(const wax::obj &key_, wax::obj &val){ void usrp2_mboard_impl::rx_codec_set(const wax::obj &key_, const wax::obj &val){ named_prop_t key = named_prop_t::extract(key_); - float gain; - switch(key.as<codec_prop_t>()) { + switch(key.as<codec_prop_t>()) { case CODEC_PROP_GAIN_I: case CODEC_PROP_GAIN_Q: - if(!_iface->is_usrp2p()) UHD_THROW_PROP_SET_ERROR();//this capability is only found in USRP2P - - gain = val.as<float>(); - this->rx_codec_set_gain(gain, key.name); - return; + this->rx_codec_set_gain(val.as<float>(), key.name); + return; - default: - UHD_THROW_PROP_SET_ERROR(); + default: UHD_THROW_PROP_SET_ERROR(); } } |