diff options
author | Nick Foster <nick@nerdnetworks.org> | 2010-10-05 11:13:25 -0700 |
---|---|---|
committer | Nick Foster <nick@nerdnetworks.org> | 2010-10-05 11:14:45 -0700 |
commit | e4d088fa9169eef81473cb7d83bda7c82bc5d243 (patch) | |
tree | 0798f4c0863bcb27ff4164f9e2fcc2ccd7bf80d3 /host/lib/usrp/usrp1/usrp1_impl.cpp | |
parent | 6dd502737bcf6e59933be01720672db9a496803b (diff) | |
parent | bd3bd0dfbc1a87af5839c9b23450434cfb9c763c (diff) | |
download | uhd-e4d088fa9169eef81473cb7d83bda7c82bc5d243.tar.gz uhd-e4d088fa9169eef81473cb7d83bda7c82bc5d243.tar.bz2 uhd-e4d088fa9169eef81473cb7d83bda7c82bc5d243.zip |
Merge branch 'master' of ettus.sourcerepo.com:ettus/uhdpriv into usrp2p
Conflicts:
host/lib/ic_reg_maps/CMakeLists.txt
host/lib/usrp/usrp2/io_impl.cpp
Diffstat (limited to 'host/lib/usrp/usrp1/usrp1_impl.cpp')
-rw-r--r-- | host/lib/usrp/usrp1/usrp1_impl.cpp | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/host/lib/usrp/usrp1/usrp1_impl.cpp b/host/lib/usrp/usrp1/usrp1_impl.cpp index 793e3027d..156fc119f 100644 --- a/host/lib/usrp/usrp1/usrp1_impl.cpp +++ b/host/lib/usrp/usrp1/usrp1_impl.cpp @@ -83,9 +83,7 @@ static device_addrs_t usrp1_find(const device_addr_t &hint) //find the usrps and load firmware BOOST_FOREACH(usb_device_handle::sptr handle, usb_device_handle::get_device_list(vid, pid)) { - usb_control::sptr ctrl_transport = usb_control::make(handle); - usrp_ctrl::sptr usrp_ctrl = usrp_ctrl::make(ctrl_transport); - usrp_ctrl->usrp_load_firmware(usrp1_fw_image); + usrp_ctrl::make(usb_control::make(handle))->usrp_load_firmware(usrp1_fw_image); } //get descriptors again with serial number, but using the initialized VID/PID now since we have firmware @@ -93,13 +91,13 @@ static device_addrs_t usrp1_find(const device_addr_t &hint) pid = USRP1_PRODUCT_ID; BOOST_FOREACH(usb_device_handle::sptr handle, usb_device_handle::get_device_list(vid, pid)) { - device_addr_t new_addr; - new_addr["type"] = "usrp1"; - new_addr["serial"] = handle->get_serial(); - //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); - } + device_addr_t new_addr; + new_addr["type"] = "usrp1"; + new_addr["serial"] = handle->get_serial(); + //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; @@ -109,12 +107,12 @@ static device_addrs_t usrp1_find(const device_addr_t &hint) * Make **********************************************************************/ template<typename output_type> static output_type cast_from_dev_addr( - const device_addr_t &device_addr, - const std::string &key, - output_type def_val + const device_addr_t &device_addr, + const std::string &key, + output_type def_val ){ - return (device_addr.has_key(key))? - boost::lexical_cast<output_type>(device_addr[key]) : def_val; + return (device_addr.has_key(key))? + boost::lexical_cast<output_type>(device_addr[key]) : def_val; } static device::sptr usrp1_make(const device_addr_t &device_addr) |