summaryrefslogtreecommitdiffstats
path: root/host/lib/usrp
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-09-28 11:11:29 -0700
committerJosh Blum <josh@joshknows.com>2010-09-28 11:11:29 -0700
commit071c4d4226d9cbeb1f1f67139261b13205816d8a (patch)
tree6593df48a731cb6bff687822b284fcba649cf6f6 /host/lib/usrp
parentf5bdb7ccb39ef23d4b2c0872fe410e9d5d031958 (diff)
parent852f5c5f7b31bfb2e7561a86ca9f5380bd53d130 (diff)
downloaduhd-071c4d4226d9cbeb1f1f67139261b13205816d8a.tar.gz
uhd-071c4d4226d9cbeb1f1f67139261b13205816d8a.tar.bz2
uhd-071c4d4226d9cbeb1f1f67139261b13205816d8a.zip
Merge branch 'master' into libusb
Diffstat (limited to 'host/lib/usrp')
-rw-r--r--host/lib/usrp/dboard_manager.cpp25
-rw-r--r--host/lib/usrp/usrp1/usrp1_impl.cpp5
-rw-r--r--host/lib/usrp/usrp2/io_impl.cpp2
3 files changed, 24 insertions, 8 deletions
diff --git a/host/lib/usrp/dboard_manager.cpp b/host/lib/usrp/dboard_manager.cpp
index ab80875f5..181f843a0 100644
--- a/host/lib/usrp/dboard_manager.cpp
+++ b/host/lib/usrp/dboard_manager.cpp
@@ -18,6 +18,7 @@
#include "dboard_ctor_args.hpp"
#include <uhd/usrp/dboard_manager.hpp>
#include <uhd/usrp/subdev_props.hpp>
+#include <uhd/utils/warning.hpp>
#include <uhd/utils/static.hpp>
#include <uhd/utils/assert.hpp>
#include <uhd/types/dict.hpp>
@@ -176,10 +177,6 @@ static args_t get_dboard_args(
){
//special case, the none id was provided, use the following ids
if (dboard_id == dboard_id_t::none() or force_to_unknown){
- std::cerr << boost::format(
- "Warning: unknown dboard-id or dboard-id combination: %s\n"
- " -> defaulting to the unknown board type"
- ) % dboard_id.to_pp_string() << std::endl;
UHD_ASSERT_THROW(get_id_to_args_map().has_key(0xfff1));
UHD_ASSERT_THROW(get_id_to_args_map().has_key(0xfff0));
switch(unit){
@@ -191,6 +188,9 @@ static args_t get_dboard_args(
//verify that there is a registered constructor for this id
if (not get_id_to_args_map().has_key(dboard_id)){
+ uhd::print_warning(str(boost::format(
+ "Unknown dboard ID: %s.\n"
+ ) % dboard_id.to_pp_string()));
return get_dboard_args(unit, dboard_id, true);
}
@@ -214,12 +214,25 @@ dboard_manager_impl::dboard_manager_impl(
(get_xcvr_id_to_id_map()[tx_dboard_id] == rx_dboard_id)
);
+ //warn for invalid dboard id xcvr combinations
+ if (rx_dboard_is_xcvr != this_dboard_is_xcvr or tx_dboard_is_xcvr != this_dboard_is_xcvr){
+ uhd::print_warning(str(boost::format(
+ "Unknown transceiver board ID combination...\n"
+ "RX dboard ID: %s\n"
+ "TX dboard ID: %s\n"
+ ) % rx_dboard_id.to_pp_string() % tx_dboard_id.to_pp_string()));
+ }
+
//extract dboard constructor and settings (force to unknown for messed up xcvr status)
dboard_ctor_t rx_dboard_ctor; std::string rx_name; prop_names_t rx_subdevs;
- boost::tie(rx_dboard_ctor, rx_name, rx_subdevs) = get_dboard_args(dboard_iface::UNIT_RX, rx_dboard_id, rx_dboard_is_xcvr != this_dboard_is_xcvr);
+ boost::tie(rx_dboard_ctor, rx_name, rx_subdevs) = get_dboard_args(
+ dboard_iface::UNIT_RX, rx_dboard_id, rx_dboard_is_xcvr != this_dboard_is_xcvr
+ );
dboard_ctor_t tx_dboard_ctor; std::string tx_name; prop_names_t tx_subdevs;
- boost::tie(tx_dboard_ctor, tx_name, tx_subdevs) = get_dboard_args(dboard_iface::UNIT_TX, tx_dboard_id, tx_dboard_is_xcvr != this_dboard_is_xcvr);
+ boost::tie(tx_dboard_ctor, tx_name, tx_subdevs) = get_dboard_args(
+ dboard_iface::UNIT_TX, tx_dboard_id, tx_dboard_is_xcvr != this_dboard_is_xcvr
+ );
//initialize the gpio pins before creating subdevs
set_nice_dboard_if();
diff --git a/host/lib/usrp/usrp1/usrp1_impl.cpp b/host/lib/usrp/usrp1/usrp1_impl.cpp
index a56649305..b4c23bf12 100644
--- a/host/lib/usrp/usrp1/usrp1_impl.cpp
+++ b/host/lib/usrp/usrp1/usrp1_impl.cpp
@@ -95,7 +95,10 @@ static device_addrs_t usrp1_find(const device_addr_t &hint)
device_addr_t new_addr;
new_addr["type"] = "usrp1";
new_addr["serial"] = handle->get_serial();
- usrp1_addrs.push_back(new_addr);
+ //this is a found usrp1 when a hint serial is not specified or it matches
+ if (not hint.has_key("serial") or hint["serial"] == new_addr["serial"]){
+ usrp1_addrs.push_back(new_addr);
+ }
}
return usrp1_addrs;
diff --git a/host/lib/usrp/usrp2/io_impl.cpp b/host/lib/usrp/usrp2/io_impl.cpp
index 91a1b2344..65411801d 100644
--- a/host/lib/usrp/usrp2/io_impl.cpp
+++ b/host/lib/usrp/usrp2/io_impl.cpp
@@ -150,7 +150,7 @@ void usrp2_impl::io_init(void){
std::memcpy(send_buff->cast<void*>(), &data, sizeof(data));
send_buff->commit(sizeof(data));
//drain the recv buffers (may have junk)
- while (data_transport->get_recv_buff().get());
+ while (data_transport->get_recv_buff().get()){};
}
//the number of recv frames is the number for the first transport