summaryrefslogtreecommitdiffstats
path: root/host/lib
diff options
context:
space:
mode:
authorNick Foster <nick@nerdnetworks.org>2011-02-03 16:05:00 -0800
committerNick Foster <nick@nerdnetworks.org>2011-02-03 16:05:00 -0800
commit5d459d1cb09cdce0c1fd4d7e7d0259310921b94f (patch)
treed0b91c0179141e04d20fe245f81e1708fc1f7f4f /host/lib
parent6ccd8fc94607d5e81ac4c8a819e9ce89966a6692 (diff)
downloaduhd-5d459d1cb09cdce0c1fd4d7e7d0259310921b94f.tar.gz
uhd-5d459d1cb09cdce0c1fd4d7e7d0259310921b94f.tar.bz2
uhd-5d459d1cb09cdce0c1fd4d7e7d0259310921b94f.zip
N210: initialize codec gains so it doesn't barf if you call get_rx_gain before set_rx_gain.
Diffstat (limited to 'host/lib')
-rw-r--r--host/lib/usrp/usrp2/codec_impl.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/host/lib/usrp/usrp2/codec_impl.cpp b/host/lib/usrp/usrp2/codec_impl.cpp
index d7078d985..09bec6db2 100644
--- a/host/lib/usrp/usrp2/codec_impl.cpp
+++ b/host/lib/usrp/usrp2/codec_impl.cpp
@@ -47,6 +47,12 @@ void usrp2_mboard_impl::codec_init(void){
boost::bind(&usrp2_mboard_impl::tx_codec_get, this, _1, _2),
boost::bind(&usrp2_mboard_impl::tx_codec_set, this, _1, _2)
);
+
+ //initialize gain names. keeps get_rx_gain() from getting a gain
+ //that hasn't been set yet.
+ BOOST_FOREACH(std::string key, codec_rx_gain_ranges.keys()) {
+ _codec_rx_gains[key] = codec_rx_gain_ranges[key].start();
+ }
}
/***********************************************************************