From 8e54b58d89c4d5f0f24bf15e8508cb3d97d69d34 Mon Sep 17 00:00:00 2001 From: michael-west Date: Fri, 31 Mar 2023 12:06:30 -0700 Subject: [PATCH] octoclock: Fix uhd_usrp_probe error Running the uhd_usrp_probe utility was resulting in an error due to type mismatch between the utility and the data type in the property tree. The data type has been made consistent for all utilities and underlying implementation code as a mboard_eeprom_t. This reverts "octoclock: Fix type of eeprom object in property_tree". Signed-off-by: michael-west --- host/lib/usrp_clock/octoclock/octoclock_impl.cpp | 7 +++++-- host/utils/octoclock_burn_eeprom.cpp | 16 ++++++++-------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/host/lib/usrp_clock/octoclock/octoclock_impl.cpp b/host/lib/usrp_clock/octoclock/octoclock_impl.cpp index 71cbe60f4..b4185eded 100644 --- a/host/lib/usrp_clock/octoclock/octoclock_impl.cpp +++ b/host/lib/usrp_clock/octoclock/octoclock_impl.cpp @@ -264,10 +264,13 @@ octoclock_impl::octoclock_impl(const device_addr_t& _device_addr) // Set up EEPROM //////////////////////////////////////////////////////////////////// _oc_dict[oc].eeprom = octoclock_eeprom_t(_oc_dict[oc].ctrl_xport, _proto_ver); - _tree->create(oc_path / "eeprom") + _tree->create(oc_path / "eeprom") .set(_oc_dict[oc].eeprom) .add_coerced_subscriber( - std::bind(&octoclock_impl::_set_eeprom, this, oc, std::placeholders::_1)); + std::bind(&octoclock_impl::_set_eeprom, this, oc, std::placeholders::_1)) + .set_publisher([this, oc]() { + return static_cast(this->_oc_dict[oc].eeprom); + }); //////////////////////////////////////////////////////////////////// // Initialize non-GPSDO sensors diff --git a/host/utils/octoclock_burn_eeprom.cpp b/host/utils/octoclock_burn_eeprom.cpp index 1e8341e13..7b116499a 100644 --- a/host/utils/octoclock_burn_eeprom.cpp +++ b/host/utils/octoclock_burn_eeprom.cpp @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include #include #include @@ -19,7 +19,7 @@ namespace po = boost::program_options; using namespace uhd; -using namespace uhd::usrp_clock; +using namespace uhd::usrp; int UHD_SAFE_MAIN(int argc, char* argv[]) { @@ -51,8 +51,8 @@ int UHD_SAFE_MAIN(int argc, char* argv[]) std::cout << "Creating OctoClock device from args: " + args << std::endl; device::sptr oc = device::make(args, device::CLOCK); property_tree::sptr tree = oc->get_tree(); - octoclock_eeprom_t oc_eeprom = - tree->access("/mboards/0/eeprom").get(); + mboard_eeprom_t oc_eeprom = + tree->access("/mboards/0/eeprom").get(); std::cout << std::endl; std::vector keys_vec, vals_vec; @@ -89,10 +89,10 @@ int UHD_SAFE_MAIN(int argc, char* argv[]) << std::endl; } } - tree->access("/mboards/0/eeprom").set(oc_eeprom); + tree->access("/mboards/0/eeprom").set(oc_eeprom); + std::cout << std::endl + << "Power-cycle your device to allow any changes to take effect." + << std::endl; } - std::cout << std::endl - << "Power-cycle your device to allow any changes to take effect." - << std::endl; return EXIT_SUCCESS; }