aboutsummaryrefslogtreecommitdiffstats
path: root/host/utils/usrp_burn_mb_eeprom.cpp
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-11-05 17:56:23 -0700
committerJosh Blum <josh@joshknows.com>2010-11-05 17:56:23 -0700
commit1a86e65a18ac7005f0a4dae3bc7fc26e8041267c (patch)
tree77c4e71f6e9fbe8143b4dbc376611985238eec86 /host/utils/usrp_burn_mb_eeprom.cpp
parent94a492dc40a6450ada3fe34a7440c31077d9690e (diff)
downloaduhd-1a86e65a18ac7005f0a4dae3bc7fc26e8041267c.tar.gz
uhd-1a86e65a18ac7005f0a4dae3bc7fc26e8041267c.tar.bz2
uhd-1a86e65a18ac7005f0a4dae3bc7fc26e8041267c.zip
uhd: for eeprom writeback, write and set only those values changed
Diffstat (limited to 'host/utils/usrp_burn_mb_eeprom.cpp')
-rw-r--r--host/utils/usrp_burn_mb_eeprom.cpp24
1 files changed, 13 insertions, 11 deletions
diff --git a/host/utils/usrp_burn_mb_eeprom.cpp b/host/utils/usrp_burn_mb_eeprom.cpp
index 8d0835222..20e1b58b1 100644
--- a/host/utils/usrp_burn_mb_eeprom.cpp
+++ b/host/utils/usrp_burn_mb_eeprom.cpp
@@ -53,25 +53,27 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
std::cout << "Creating USRP device from address: " + args << std::endl;
uhd::device::sptr dev = uhd::device::make(args);
- std::cout << std::endl;
-
- std::cout << "Fetching current settings from EEPROM..." << std::endl;
//FIXME the default mboard for now (may be others)
wax::obj mboard = (*dev)[uhd::usrp::DEVICE_PROP_MBOARD];
- uhd::usrp::mboard_eeprom_t mb_eeprom = \
- mboard[uhd::usrp::MBOARD_PROP_EEPROM_MAP].as<uhd::usrp::mboard_eeprom_t>();
- if (not mb_eeprom.has_key(key)){
- std::cerr << boost::format("Cannot find value for EEPROM[%s]") % key << std::endl;
- return ~0;
- }
- std::cout << boost::format(" EEPROM [\"%s\"] is \"%s\"") % key % mb_eeprom[key] << std::endl;
std::cout << std::endl;
+ if (true /*always readback*/){
+ std::cout << "Fetching current settings from EEPROM..." << std::endl;
+ uhd::usrp::mboard_eeprom_t mb_eeprom = \
+ mboard[uhd::usrp::MBOARD_PROP_EEPROM_MAP].as<uhd::usrp::mboard_eeprom_t>();
+ if (not mb_eeprom.has_key(key)){
+ std::cerr << boost::format("Cannot find value for EEPROM[%s]") % key << std::endl;
+ return ~0;
+ }
+ std::cout << boost::format(" EEPROM [\"%s\"] is \"%s\"") % key % mb_eeprom[key] << std::endl;
+ std::cout << std::endl;
+ }
if (vm.count("val")){
+ uhd::usrp::mboard_eeprom_t mb_eeprom; mb_eeprom[key] = val;
std::cout << boost::format("Setting EEPROM [\"%s\"] to \"%s\"...") % key % val << std::endl;
- mb_eeprom[key] = val;
mboard[uhd::usrp::MBOARD_PROP_EEPROM_MAP] = mb_eeprom;
std::cout << "Power-cycle the USRP device for the changes to take effect." << std::endl;
+ std::cout << std::endl;
}
std::cout << "Done" << std::endl;