summaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/usrp2
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-08-11 12:27:18 -0700
committerJosh Blum <josh@joshknows.com>2010-08-11 12:27:18 -0700
commit54048fd9b227633c724edd975347c81152ab37b2 (patch)
treef922ac5f19fa26249360b3c6614ceb45d482b391 /host/lib/usrp/usrp2
parent9503c5101007ba1261b8d23ee6a17305bbaa6f2a (diff)
downloaduhd-54048fd9b227633c724edd975347c81152ab37b2.tar.gz
uhd-54048fd9b227633c724edd975347c81152ab37b2.tar.bz2
uhd-54048fd9b227633c724edd975347c81152ab37b2.zip
usrp: added subdev spec verification functions
Diffstat (limited to 'host/lib/usrp/usrp2')
-rw-r--r--host/lib/usrp/usrp2/mboard_impl.cpp15
1 files changed, 3 insertions, 12 deletions
diff --git a/host/lib/usrp/usrp2/mboard_impl.cpp b/host/lib/usrp/usrp2/mboard_impl.cpp
index 610aade14..fe3ec6785 100644
--- a/host/lib/usrp/usrp2/mboard_impl.cpp
+++ b/host/lib/usrp/usrp2/mboard_impl.cpp
@@ -17,6 +17,7 @@
#include "usrp2_impl.hpp"
#include "usrp2_regs.hpp"
+#include "../misc_utils.hpp"
#include "../dsp_utils.hpp"
#include <uhd/usrp/mboard_props.hpp>
#include <uhd/utils/assert.hpp>
@@ -324,14 +325,9 @@ void usrp2_mboard_impl::set(const wax::obj &key, const wax::obj &val){
case MBOARD_PROP_RX_SUBDEV_SPEC:
_rx_subdev_spec = val.as<subdev_spec_t>();
- //handle automatic
- if (_rx_subdev_spec.empty()) _rx_subdev_spec.push_back(
- subdev_spec_pair_t("", _dboard_manager->get_rx_subdev_names().front())
- );
+ verify_rx_subdev_spec(_rx_subdev_spec, this->get_link());
//sanity check
UHD_ASSERT_THROW(_rx_subdev_spec.size() == 1);
- uhd::assert_has((*this)[MBOARD_PROP_RX_DBOARD_NAMES].as<prop_names_t>(), _rx_subdev_spec.front().db_name, "rx dboard names");
- uhd::assert_has(_dboard_manager->get_rx_subdev_names(), _rx_subdev_spec.front().sd_name, "rx subdev names");
//set the mux
_iface->poke32(U2_REG_DSP_RX_MUX, dsp_type1::calc_rx_mux_word(
_dboard_manager->get_rx_subdev(_rx_subdev_spec.front().sd_name)[SUBDEV_PROP_CONNECTION].as<subdev_conn_t>()
@@ -340,14 +336,9 @@ void usrp2_mboard_impl::set(const wax::obj &key, const wax::obj &val){
case MBOARD_PROP_TX_SUBDEV_SPEC:
_tx_subdev_spec = val.as<subdev_spec_t>();
- //handle automatic
- if (_tx_subdev_spec.empty()) _tx_subdev_spec.push_back(
- subdev_spec_pair_t("", _dboard_manager->get_tx_subdev_names().front())
- );
+ verify_tx_subdev_spec(_tx_subdev_spec, this->get_link());
//sanity check
UHD_ASSERT_THROW(_tx_subdev_spec.size() == 1);
- uhd::assert_has((*this)[MBOARD_PROP_TX_DBOARD_NAMES].as<prop_names_t>(), _tx_subdev_spec.front().db_name, "tx dboard names");
- uhd::assert_has(_dboard_manager->get_tx_subdev_names(), _tx_subdev_spec.front().sd_name, "tx subdev names");
//set the mux
_iface->poke32(U2_REG_DSP_TX_MUX, dsp_type1::calc_tx_mux_word(
_dboard_manager->get_tx_subdev(_tx_subdev_spec.front().sd_name)[SUBDEV_PROP_CONNECTION].as<subdev_conn_t>()