summaryrefslogtreecommitdiffstats
path: root/host/lib/usrp
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-08-08 19:36:16 -0700
committerJosh Blum <josh@joshknows.com>2011-08-08 19:36:16 -0700
commitd44279498462911c7ea698ac5924da6025f2112a (patch)
tree72c8b89c948978126c14ee8fcf276cfb0a80dfb0 /host/lib/usrp
parent0aa3e4e6782527aebb6d5e21160337b5e5dd98a4 (diff)
downloaduhd-d44279498462911c7ea698ac5924da6025f2112a.tar.gz
uhd-d44279498462911c7ea698ac5924da6025f2112a.tar.bz2
uhd-d44279498462911c7ea698ac5924da6025f2112a.zip
usrp1: handle special case of no rx or no tx dsps
Diffstat (limited to 'host/lib/usrp')
-rw-r--r--host/lib/usrp/usrp1/usrp1_impl.cpp8
1 files 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<int>(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<double>(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<int>(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<double>(tx_dsp_path / "rate/value")
@@ -380,8 +382,10 @@ usrp1_impl::usrp1_impl(const device_addr_t &device_addr){
_tree->access<double>(mb_path / "tx_dsps" / name / "rate" / "value").set(1e6);
}
- _tree->access<subdev_spec_t>(mb_path / "rx_subdev_spec").set(_rx_subdev_spec);
- _tree->access<subdev_spec_t>(mb_path / "tx_subdev_spec").set(_tx_subdev_spec);
+ if (_tree->list(mb_path / "rx_dsps").size() > 0)
+ _tree->access<subdev_spec_t>(mb_path / "rx_subdev_spec").set(_rx_subdev_spec);
+ if (_tree->list(mb_path / "tx_dsps").size() > 0)
+ _tree->access<subdev_spec_t>(mb_path / "tx_subdev_spec").set(_tx_subdev_spec);
}