aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/usrp1
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2012-01-27 19:09:58 -0800
committerJosh Blum <josh@joshknows.com>2012-01-27 19:09:58 -0800
commite30cf4ec6d3c5e5c83fdb8e4ee39632fdb46c0df (patch)
treeccd0633e16c3d378f1e49f4c22e088dcda3f2cd2 /host/lib/usrp/usrp1
parent837437c65ce36d418cceb3df5b093f9497b3af5f (diff)
downloaduhd-e30cf4ec6d3c5e5c83fdb8e4ee39632fdb46c0df.tar.gz
uhd-e30cf4ec6d3c5e5c83fdb8e4ee39632fdb46c0df.tar.bz2
uhd-e30cf4ec6d3c5e5c83fdb8e4ee39632fdb46c0df.zip
usrp1/b100: reenumeration loop with timeout only when found
Diffstat (limited to 'host/lib/usrp/usrp1')
-rw-r--r--host/lib/usrp/usrp1/usrp1_impl.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/host/lib/usrp/usrp1/usrp1_impl.cpp b/host/lib/usrp/usrp1/usrp1_impl.cpp
index e40dd001d..ef8ae950d 100644
--- a/host/lib/usrp/usrp1/usrp1_impl.cpp
+++ b/host/lib/usrp/usrp1/usrp1_impl.cpp
@@ -81,6 +81,7 @@ static device_addrs_t usrp1_find(const device_addr_t &hint)
// This requirement is a courtesy of libusb1.0 on windows.
//find the usrps and load firmware
+ size_t found = 0;
BOOST_FOREACH(usb_device_handle::sptr handle, usb_device_handle::get_device_list(vid, pid)) {
//extract the firmware path for the USRP1
std::string usrp1_fw_image;
@@ -101,6 +102,7 @@ static device_addrs_t usrp1_find(const device_addr_t &hint)
catch(const uhd::exception &){continue;} //ignore claimed
fx2_ctrl::make(control)->usrp_load_firmware(usrp1_fw_image);
+ found++;
}
//get descriptors again with serial number, but using the initialized VID/PID now since we have firmware
@@ -110,7 +112,7 @@ static device_addrs_t usrp1_find(const device_addr_t &hint)
const boost::system_time timeout_time = boost::get_system_time() + REENUMERATION_TIMEOUT_MS;
//search for the device until found or timeout
- while (boost::get_system_time() < timeout_time and usrp1_addrs.empty())
+ while (boost::get_system_time() < timeout_time and usrp1_addrs.empty() and found != 0)
{
BOOST_FOREACH(usb_device_handle::sptr handle, usb_device_handle::get_device_list(vid, pid))
{