From 92539438c228b784a0254d9b2aae143686fa672e Mon Sep 17 00:00:00 2001 From: michael-west Date: Mon, 17 Aug 2015 14:41:46 -0700 Subject: B2XX: Added B200mini support --- host/lib/usrp/b200/b200_image_loader.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'host/lib/usrp/b200/b200_image_loader.cpp') 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 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(product))){ + if(not B2XX_PRODUCT_ID.has_key(boost::lexical_cast(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; -- cgit v1.2.3