diff options
author | Martin Braun <martin.braun@ettus.com> | 2016-11-28 12:17:39 -0800 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2016-11-28 12:17:39 -0800 |
commit | fc54c27b48028c9c8139175d40b4b061800f32e3 (patch) | |
tree | bd4ef22159d5bd65458e50fb3e5050a9b63559bf /host/lib/rfnoc | |
parent | 9fe731cc371efee7f0051186697e611571c5b41b (diff) | |
parent | 33c0b32db12ee154b1090360fbf76634590fdd3e (diff) | |
download | uhd-fc54c27b48028c9c8139175d40b4b061800f32e3.tar.gz uhd-fc54c27b48028c9c8139175d40b4b061800f32e3.tar.bz2 uhd-fc54c27b48028c9c8139175d40b4b061800f32e3.zip |
Merge branch 'maint'
Diffstat (limited to 'host/lib/rfnoc')
-rw-r--r-- | host/lib/rfnoc/block_ctrl_base.cpp | 2 | ||||
-rw-r--r-- | host/lib/rfnoc/legacy_compat.cpp | 32 |
2 files changed, 33 insertions, 1 deletions
diff --git a/host/lib/rfnoc/block_ctrl_base.cpp b/host/lib/rfnoc/block_ctrl_base.cpp index 20299a3c3..fa4928a69 100644 --- a/host/lib/rfnoc/block_ctrl_base.cpp +++ b/host/lib/rfnoc/block_ctrl_base.cpp @@ -408,7 +408,7 @@ void block_ctrl_base::clear_command_time(const size_t port) iface_sptr->set_time(time_spec_t(0.0)); } -void block_ctrl_base::clear(const size_t /* port */) +void block_ctrl_base::clear() { UHD_RFNOC_BLOCK_TRACE() << "block_ctrl_base::clear() " << std::endl; // Call parent... diff --git a/host/lib/rfnoc/legacy_compat.cpp b/host/lib/rfnoc/legacy_compat.cpp index e1eff757e..b660a21c7 100644 --- a/host/lib/rfnoc/legacy_compat.cpp +++ b/host/lib/rfnoc/legacy_compat.cpp @@ -103,6 +103,15 @@ uhd::meta_range_t lambda_const_meta_range(const double start, const double stop, { return uhd::meta_range_t(start, stop, step); } + +/*! Recreate passed property without bound subscribers. Maintains current property value. +*/ +template <typename T> +static void recreate_property(const uhd::fs_path &path, uhd::property_tree::sptr &tree) { + T temp = tree->access<T>(path).get(); + tree->remove(path); + tree->create<T>(path).set(temp); +} /************************************************************************ * Class Definition ***********************************************************************/ @@ -169,6 +178,11 @@ public: } } + ~legacy_compat_impl() + { + remove_prop_subscribers(); + } + /************************************************************************ * API Calls ***********************************************************************/ @@ -590,6 +604,24 @@ private: // methods } } + + /*! Remove properties with bound functions in property tree and recreate + */ + void remove_prop_subscribers() + { + for (size_t mboard_idx = 0; mboard_idx < _num_mboards; mboard_idx++) { + uhd::fs_path root = mb_root(mboard_idx); + // Subdev specs + if (_tree->exists(root / "tx_subdev_spec")) { + recreate_property<subdev_spec_t>(root / "tx_subdev_spec", _tree); + } + + if (_tree->exists(root / "rx_subdev_spec")) { + recreate_property<subdev_spec_t>(root / "rx_subdev_spec", _tree); + } + } + } + /*! Default block connections. * * Tx connections: |