From d44279498462911c7ea698ac5924da6025f2112a Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Mon, 8 Aug 2011 19:36:16 -0700 Subject: usrp1: handle special case of no rx or no tx dsps --- host/lib/usrp/usrp1/usrp1_impl.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/host/lib/usrp/usrp1/usrp1_impl.cpp b/host/lib/usrp/usrp1/usrp1_impl.cpp index 7c9e61e94..8f6a582fa 100644 --- a/host/lib/usrp/usrp1/usrp1_impl.cpp +++ b/host/lib/usrp/usrp1/usrp1_impl.cpp @@ -269,6 +269,7 @@ usrp1_impl::usrp1_impl(const device_addr_t &device_addr){ //////////////////////////////////////////////////////////////////// // create rx dsp control objects //////////////////////////////////////////////////////////////////// + _tree->create(mb_path / "rx_dsps"); //dummy in case we have none for (size_t dspno = 0; dspno < get_num_ddcs(); dspno++){ fs_path rx_dsp_path = mb_path / str(boost::format("rx_dsps/%u") % dspno); _tree->create(rx_dsp_path / "rate/value") @@ -288,6 +289,7 @@ usrp1_impl::usrp1_impl(const device_addr_t &device_addr){ //////////////////////////////////////////////////////////////////// // create tx dsp control objects //////////////////////////////////////////////////////////////////// + _tree->create(mb_path / "tx_dsps"); //dummy in case we have none for (size_t dspno = 0; dspno < get_num_ducs(); dspno++){ fs_path tx_dsp_path = mb_path / str(boost::format("tx_dsps/%u") % dspno); _tree->create(tx_dsp_path / "rate/value") @@ -380,8 +382,10 @@ usrp1_impl::usrp1_impl(const device_addr_t &device_addr){ _tree->access(mb_path / "tx_dsps" / name / "rate" / "value").set(1e6); } - _tree->access(mb_path / "rx_subdev_spec").set(_rx_subdev_spec); - _tree->access(mb_path / "tx_subdev_spec").set(_tx_subdev_spec); + if (_tree->list(mb_path / "rx_dsps").size() > 0) + _tree->access(mb_path / "rx_subdev_spec").set(_rx_subdev_spec); + if (_tree->list(mb_path / "tx_dsps").size() > 0) + _tree->access(mb_path / "tx_subdev_spec").set(_tx_subdev_spec); } -- cgit v1.2.3