diff options
author | Martin Braun <martin.braun@ettus.com> | 2020-02-03 14:39:10 -0800 |
---|---|---|
committer | atrnati <54334261+atrnati@users.noreply.github.com> | 2020-02-04 08:53:01 -0600 |
commit | 8be5e2d4dd79e7c0324762fe33cc48aada85c317 (patch) | |
tree | 57466a3531ed1d8d07ee2f5a431b216300af9e79 /host | |
parent | 4b1d346a80f860ebcf26712b721606c19dd904dd (diff) | |
download | uhd-8be5e2d4dd79e7c0324762fe33cc48aada85c317.tar.gz uhd-8be5e2d4dd79e7c0324762fe33cc48aada85c317.tar.bz2 uhd-8be5e2d4dd79e7c0324762fe33cc48aada85c317.zip |
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.
Diffstat (limited to 'host')
-rw-r--r-- | host/include/uhd/usrp_clock/octoclock_eeprom.hpp | 3 | ||||
-rw-r--r-- | host/lib/usrp_clock/octoclock/octoclock_impl.cpp | 9 | ||||
-rw-r--r-- | host/lib/usrp_clock/octoclock/octoclock_impl.hpp | 4 |
3 files changed, 10 insertions, 6 deletions
diff --git a/host/include/uhd/usrp_clock/octoclock_eeprom.hpp b/host/include/uhd/usrp_clock/octoclock_eeprom.hpp index 3d514ebc2..af4df2d5f 100644 --- a/host/include/uhd/usrp_clock/octoclock_eeprom.hpp +++ b/host/include/uhd/usrp_clock/octoclock_eeprom.hpp @@ -11,6 +11,7 @@ #include <uhd/config.hpp> #include <uhd/transport/udp_simple.hpp> #include <uhd/types/dict.hpp> +#include <uhd/usrp/mboard_eeprom.hpp> #include <string> namespace uhd { namespace usrp_clock { @@ -22,7 +23,7 @@ namespace uhd { namespace usrp_clock { * Use the dictionary interface to get and set values. * Commit to the EEPROM to save changed settings. */ -class UHD_API octoclock_eeprom_t : public uhd::dict<std::string, std::string> +class UHD_API octoclock_eeprom_t : public uhd::usrp::mboard_eeprom_t { public: //! Make a new empty OctoClock EEPROM handler 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<octoclock_eeprom_t>(oc_path / "eeprom") + _tree->create<uhd::usrp::mboard_eeprom_t>(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<uhd::usrp::mboard_eeprom_t>(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 <uhd/types/dict.hpp> #include <uhd/types/sensors.hpp> #include <uhd/usrp/gps_ctrl.hpp> +#include <uhd/usrp/mboard_eeprom.hpp> #include <uhd/usrp_clock/octoclock_eeprom.hpp> #include <boost/thread.hpp> #include <memory> @@ -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); |