aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/b200/b200_image_loader.cpp
diff options
context:
space:
mode:
authormichael-west <michael.west@ettus.com>2015-08-17 14:41:46 -0700
committerMartin Braun <martin.braun@ettus.com>2015-08-17 18:10:09 -0700
commit92539438c228b784a0254d9b2aae143686fa672e (patch)
tree7c50343a852d64956ba77e89f5029d5863768428 /host/lib/usrp/b200/b200_image_loader.cpp
parent868cbac336eb4e4191079ba08c97fa9b40890157 (diff)
downloaduhd-92539438c228b784a0254d9b2aae143686fa672e.tar.gz
uhd-92539438c228b784a0254d9b2aae143686fa672e.tar.bz2
uhd-92539438c228b784a0254d9b2aae143686fa672e.zip
B2XX: Added B200mini support
Diffstat (limited to 'host/lib/usrp/b200/b200_image_loader.cpp')
-rw-r--r--host/lib/usrp/b200/b200_image_loader.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/host/lib/usrp/b200/b200_image_loader.cpp b/host/lib/usrp/b200/b200_image_loader.cpp
index 9eaeeff63..e8fb8afea 100644
--- a/host/lib/usrp/b200/b200_image_loader.cpp
+++ b/host/lib/usrp/b200/b200_image_loader.cpp
@@ -35,8 +35,8 @@ using namespace uhd::transport;
namespace uhd{
-static b200_iface::sptr get_b200_iface(const image_loader::image_loader_args_t &image_loader_args,
- mboard_eeprom_t &mb_eeprom,
+static b200_iface::sptr get_b200_iface(const image_loader::image_loader_args_t& image_loader_args,
+ mboard_eeprom_t &mb_eeprom, usb_device_handle::sptr& handle,
bool user_specified){
std::vector<usb_device_handle::sptr> dev_handles = get_b200_device_handles(image_loader_args.args);
@@ -67,6 +67,7 @@ static b200_iface::sptr get_b200_iface(const image_loader::image_loader_args_t &
// At this point, we should have a single B2XX
if(applicable_dev_handles.size() == 1){
mb_eeprom = eeprom;
+ handle = applicable_dev_handles[0];
return iface;
}
else if(applicable_dev_handles.size() > 1){
@@ -76,7 +77,7 @@ static b200_iface::sptr get_b200_iface(const image_loader::image_loader_args_t &
BOOST_FOREACH(usb_device_handle::sptr dev_handle, applicable_dev_handles){
eeprom = mboard_eeprom_t(*b200_iface::make(usb_control::make(dev_handle,0)), "B200");
err_msg += str(boost::format(" * %s (serial=%s)\n")
- % B2X0_STR_NAMES.get(get_b200_type(mb_eeprom), "B2XX")
+ % B2XX_STR_NAMES.get(get_b200_product(dev_handle, mb_eeprom), "B2XX")
% mb_eeprom.get("serial"));
}
@@ -101,7 +102,8 @@ static bool b200_image_loader(const image_loader::image_loader_args_t &image_loa
// See if a B2x0 with the given args is found
mboard_eeprom_t mb_eeprom;
- b200_iface::sptr iface = get_b200_iface(image_loader_args, mb_eeprom, user_specified);
+ usb_device_handle::sptr handle;
+ b200_iface::sptr iface = get_b200_iface(image_loader_args, mb_eeprom, handle, user_specified);
if(!iface) return false; // No initialized B2x0 found
std::string fpga_path;
@@ -112,7 +114,7 @@ static bool b200_image_loader(const image_loader::image_loader_args_t &image_loa
* filename for us to use.
*/
std::string product = mb_eeprom.get("product");
- if(not B2X0_PRODUCT_ID.has_key(boost::lexical_cast<boost::uint16_t>(product))){
+ if(not B2XX_PRODUCT_ID.has_key(boost::lexical_cast<boost::uint16_t>(product))){
if(user_specified){
// The user specified a bad device but expects us to know what it is
throw uhd::runtime_error("Could not determine model. You must manually specify an FPGA image filename.");
@@ -122,13 +124,13 @@ static bool b200_image_loader(const image_loader::image_loader_args_t &image_loa
}
}
else{
- fpga_path = find_image_path(B2X0_FPGA_FILE_NAME.get(get_b200_type(mb_eeprom)));
+ fpga_path = find_image_path(B2XX_FPGA_FILE_NAME.get(get_b200_product(handle, mb_eeprom)));
}
}
else fpga_path = image_loader_args.fpga_path;
std::cout << boost::format("Unit: USRP %s (%s)")
- % B2X0_STR_NAMES.get(get_b200_type(mb_eeprom), "B2XX")
+ % B2XX_STR_NAMES.get(get_b200_product(handle, mb_eeprom), "B2XX")
% mb_eeprom.get("serial")
<< std::endl;