From 8d2262f6b324c7a441956f2c4e805f79bd55c70b Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Wed, 15 Jun 2016 19:21:55 -0700 Subject: b200: Update DSPs after changing tick rate Reviewed-By: Andrew Lynch Reviewed-By: Michael West --- host/lib/usrp/b200/b200_impl.cpp | 14 ++++++++------ host/lib/usrp/b200/b200_impl.hpp | 8 ++++++++ host/lib/usrp/b200/b200_io_impl.cpp | 16 ++++++++++++++++ 3 files changed, 32 insertions(+), 6 deletions(-) (limited to 'host/lib') diff --git a/host/lib/usrp/b200/b200_impl.cpp b/host/lib/usrp/b200/b200_impl.cpp index 734367af1..d7663c68e 100644 --- a/host/lib/usrp/b200/b200_impl.cpp +++ b/host/lib/usrp/b200/b200_impl.cpp @@ -792,9 +792,6 @@ void b200_impl::setup_radio(const size_t dspno) //////////////////////////////////////////////////////////////////// // connect rx dsp control objects //////////////////////////////////////////////////////////////////// - _tree->access(mb_path / "tick_rate") - .subscribe(boost::bind(&rx_vita_core_3000::set_tick_rate, perif.framer, _1)) - .subscribe(boost::bind(&rx_dsp_core_3000::set_tick_rate, perif.ddc, _1)); const fs_path rx_dsp_path = mb_path / "rx_dsps" / dspno; perif.ddc->populate_subtree(_tree->subtree(rx_dsp_path)); _tree->create(rx_dsp_path / "rate" / "set").set(false); @@ -805,13 +802,14 @@ void b200_impl::setup_radio(const size_t dspno) ; _tree->create(rx_dsp_path / "stream_cmd") .subscribe(boost::bind(&rx_vita_core_3000::issue_stream_command, perif.framer, _1)); + _tree->access(mb_path / "tick_rate") + .subscribe(boost::bind(&rx_vita_core_3000::set_tick_rate, perif.framer, _1)) + .subscribe(boost::bind(&b200_impl::update_rx_dsp_tick_rate, this, _1, perif.ddc, rx_dsp_path)) + ; //////////////////////////////////////////////////////////////////// // create tx dsp control objects //////////////////////////////////////////////////////////////////// - _tree->access(mb_path / "tick_rate") - .subscribe(boost::bind(&tx_vita_core_3000::set_tick_rate, perif.deframer, _1)) - .subscribe(boost::bind(&tx_dsp_core_3000::set_tick_rate, perif.duc, _1)); const fs_path tx_dsp_path = mb_path / "tx_dsps" / dspno; perif.duc->populate_subtree(_tree->subtree(tx_dsp_path)); _tree->create(tx_dsp_path / "rate" / "set").set(false); @@ -820,6 +818,10 @@ void b200_impl::setup_radio(const size_t dspno) .subscribe(boost::bind(&lambda_set_bool_prop, boost::weak_ptr(_tree), tx_dsp_path / "rate" / "set", true, _1)) .subscribe(boost::bind(&b200_impl::update_tx_samp_rate, this, dspno, _1)) ; + _tree->access(mb_path / "tick_rate") + .subscribe(boost::bind(&tx_vita_core_3000::set_tick_rate, perif.deframer, _1)) + .subscribe(boost::bind(&b200_impl::update_tx_dsp_tick_rate, this, _1, perif.duc, tx_dsp_path)) + ; //////////////////////////////////////////////////////////////////// // create RF frontend interfacing diff --git a/host/lib/usrp/b200/b200_impl.hpp b/host/lib/usrp/b200/b200_impl.hpp index 22dd231ce..6c36e883d 100644 --- a/host/lib/usrp/b200/b200_impl.hpp +++ b/host/lib/usrp/b200/b200_impl.hpp @@ -263,6 +263,14 @@ private: void update_tick_rate(const double); + /*! Subscriber to the tick_rate property, updates DDCs after tick rate change. + */ + void update_rx_dsp_tick_rate(const double, rx_dsp_core_3000::sptr, uhd::fs_path rx_dsp_path); + + /*! Subscriber to the tick_rate property, updates DUCs after tick rate change. + */ + void update_tx_dsp_tick_rate(const double, tx_dsp_core_3000::sptr, uhd::fs_path tx_dsp_path); + /*! Check if \p tick_rate works with \p chan_count channels. * * Throws a uhd::value_error if not. diff --git a/host/lib/usrp/b200/b200_io_impl.cpp b/host/lib/usrp/b200/b200_io_impl.cpp index ec37f2f6f..d0d769504 100644 --- a/host/lib/usrp/b200/b200_io_impl.cpp +++ b/host/lib/usrp/b200/b200_io_impl.cpp @@ -162,6 +162,22 @@ void b200_impl::update_tick_rate(const double new_tick_rate) } } +void b200_impl::update_rx_dsp_tick_rate(const double tick_rate, rx_dsp_core_3000::sptr ddc, uhd::fs_path rx_dsp_path) +{ + ddc->set_tick_rate(tick_rate); + if (_tree->access(rx_dsp_path / "rate" / "set").get()) { + ddc->set_host_rate(_tree->access(rx_dsp_path / "rate" / "value").get()); + } +} + +void b200_impl::update_tx_dsp_tick_rate(const double tick_rate, tx_dsp_core_3000::sptr duc, uhd::fs_path tx_dsp_path) +{ + duc->set_tick_rate(tick_rate); + if (_tree->access(tx_dsp_path / "rate" / "set").get()) { + duc->set_host_rate(_tree->access(tx_dsp_path / "rate" / "value").get()); + } +} + #define CHECK_RATE_AND_THROW(rate) \ if (uhd::math::fp_compare::fp_compare_delta(rate, uhd::math::FREQ_COMPARISON_DELTA_HZ) > \ uhd::math::fp_compare::fp_compare_delta(ad9361_device_t::AD9361_MAX_CLOCK_RATE, uhd::math::FREQ_COMPARISON_DELTA_HZ)) { \ -- cgit v1.2.3