From 5d459d1cb09cdce0c1fd4d7e7d0259310921b94f Mon Sep 17 00:00:00 2001 From: Nick Foster Date: Thu, 3 Feb 2011 16:05:00 -0800 Subject: N210: initialize codec gains so it doesn't barf if you call get_rx_gain before set_rx_gain. --- host/lib/usrp/usrp2/codec_impl.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'host/lib/usrp') 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(); + } } /*********************************************************************** -- cgit v1.2.3