From 83dde40090e0bbd91c304602cc0e3c365f7878bb Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Tue, 26 Sep 2017 18:22:25 -0700 Subject: uhd: Changed mboard_eeprom_t interface, refactored MB EEPROM code - uhd::usrp::mboard_eeprom_t is now simply a map. Its commit() method has no utility being a public API call, because the user never gets access to the appropriate I2C object (Minor API breakage) - The central mboard_eeprom.cpp file was broken up and put into many smaller compilation units in every device's implementation folder. - Renamed some of the constants (e.g. B000_* -> USRP1_*, N100_* -> N200_*) - Removed the N000_* EEPROM code, because, well, you know, there's no such device --- host/lib/usrp/b200/b200_image_loader.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 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 af79a59fc..4d0f8d937 100644 --- a/host/lib/usrp/b200/b200_image_loader.cpp +++ b/host/lib/usrp/b200/b200_image_loader.cpp @@ -46,8 +46,8 @@ static b200_iface::sptr get_b200_iface(const image_loader::image_loader_args_t& if(dev_handles.size() > 0){ for(usb_device_handle::sptr dev_handle: dev_handles){ if(dev_handle->firmware_loaded()){ - iface = b200_iface::make(usb_control::make(dev_handle,0)); - eeprom = mboard_eeprom_t(*iface, "B200"); + iface = b200_iface::make(usb_control::make(dev_handle, 0)); + eeprom = b200_impl::get_mb_eeprom(iface); if(user_specified){ if(image_loader_args.args.has_key("serial") and eeprom.get("serial") != image_loader_args.args.get("serial")){ @@ -73,8 +73,10 @@ static b200_iface::sptr get_b200_iface(const image_loader::image_loader_args_t& std::string err_msg = "Could not resolve given args to a single B2XX device.\n" "Applicable devices:\n"; - for(usb_device_handle::sptr dev_handle: applicable_dev_handles){ - eeprom = mboard_eeprom_t(*b200_iface::make(usb_control::make(dev_handle,0)), "B200"); + for (usb_device_handle::sptr dev_handle: applicable_dev_handles) { + eeprom = b200_impl::get_mb_eeprom( + b200_iface::make(usb_control::make(dev_handle, 0)) + ); err_msg += str(boost::format(" * %s (serial=%s)\n") % B2XX_STR_NAMES.get(get_b200_product(dev_handle, mb_eeprom), "B2XX") % mb_eeprom.get("serial")); @@ -88,7 +90,7 @@ static b200_iface::sptr get_b200_iface(const image_loader::image_loader_args_t& // No applicable devices found, return empty sptr so we can exit iface.reset(); - mb_eeprom = mboard_eeprom_t(); + mb_eeprom = eeprom; return iface; } -- cgit v1.2.3