From 8be5e2d4dd79e7c0324762fe33cc48aada85c317 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Mon, 3 Feb 2020 14:39:10 -0800 Subject: octoclock: Change type of EEPROM property to mboard_eeprom_t Before, the type was octoclock_eeprom_t, which was incompatible with mboard_eeprom_t and would cause issues with uhd_usrp_probe. octoclock_eeprom_t is a superset of mboard_eeprom_t, and there is no necessity for exposing the additional features to the public. This harmonizes the Octoclock prop tree with the rest of UHD, and fixes an issue where the Octoclock won't allow uhd_usrp_probe on master branch. --- host/lib/usrp_clock/octoclock/octoclock_impl.cpp | 9 ++++++--- host/lib/usrp_clock/octoclock/octoclock_impl.hpp | 4 ++-- 2 files changed, 8 insertions(+), 5 deletions(-) (limited to 'host/lib') diff --git a/host/lib/usrp_clock/octoclock/octoclock_impl.cpp b/host/lib/usrp_clock/octoclock/octoclock_impl.cpp index 146470a7b..d5f2fe192 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 @@ -352,7 +355,7 @@ bool octoclock_impl::recv_async_msg( } void octoclock_impl::_set_eeprom( - const std::string& oc, const octoclock_eeprom_t& oc_eeprom) + const std::string& oc, const uhd::usrp::mboard_eeprom_t& oc_eeprom) { /* * The OctoClock needs a full octoclock_eeprom_t so as to not erase diff --git a/host/lib/usrp_clock/octoclock/octoclock_impl.hpp b/host/lib/usrp_clock/octoclock/octoclock_impl.hpp index 01c1f91eb..8f36b17a0 100644 --- a/host/lib/usrp_clock/octoclock/octoclock_impl.hpp +++ b/host/lib/usrp_clock/octoclock/octoclock_impl.hpp @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -54,8 +55,7 @@ private: uint32_t _sequence; uint32_t _proto_ver; - void _set_eeprom( - const std::string& oc, const uhd::usrp_clock::octoclock_eeprom_t& oc_eeprom); + void _set_eeprom(const std::string& oc, const uhd::usrp::mboard_eeprom_t& oc_eeprom); uint32_t _get_fw_version(const std::string& oc); -- cgit v1.2.3