aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/b200/b200_image_loader.cpp
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2017-09-26 18:22:25 -0700
committerMartin Braun <martin.braun@ettus.com>2017-09-29 10:50:56 -0700
commit83dde40090e0bbd91c304602cc0e3c365f7878bb (patch)
treec404968e3d6d35795f331ade6ad3c176f3c1bc8b /host/lib/usrp/b200/b200_image_loader.cpp
parent59736a5bf512db83a6bd7250e14b13c7464770fc (diff)
downloaduhd-83dde40090e0bbd91c304602cc0e3c365f7878bb.tar.gz
uhd-83dde40090e0bbd91c304602cc0e3c365f7878bb.tar.bz2
uhd-83dde40090e0bbd91c304602cc0e3c365f7878bb.zip
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
Diffstat (limited to 'host/lib/usrp/b200/b200_image_loader.cpp')
-rw-r--r--host/lib/usrp/b200/b200_image_loader.cpp12
1 files changed, 7 insertions, 5 deletions
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;
}