diff options
author | michael-west <michael.west@ettus.com> | 2019-01-28 17:38:34 -0800 |
---|---|---|
committer | Ashish Chaudhari <ashish.chaudhari@ettus.com> | 2019-01-31 13:48:02 -0800 |
commit | 8d639b4b68b8328fb1e761fc5b75eb7c7f5a65d7 (patch) | |
tree | 05ea39fa35d17a94c94d6d7f676d7e005f3cddd8 /host | |
parent | f712d477b97e2ee7cca56d5afcf199f00959eb85 (diff) | |
download | uhd-8d639b4b68b8328fb1e761fc5b75eb7c7f5a65d7.tar.gz uhd-8d639b4b68b8328fb1e761fc5b75eb7c7f5a65d7.tar.bz2 uhd-8d639b4b68b8328fb1e761fc5b75eb7c7f5a65d7.zip |
X300: Fix tick and sample rate setting
- Removed incorrect function call to set tick rate in
x300_radio_ctrl_impl.
- Modified legacy compat layer to properly set tick and sample rates.
These changes eliminate the tick and sample rate warnings during X300
initialization if TwinRX is used and allow for TwinRX to be used
alongside other types of daughterboards in the same X300.
Signed-off-by: michael-west <michael.west@ettus.com>
Diffstat (limited to 'host')
-rw-r--r-- | host/lib/rfnoc/legacy_compat.cpp | 14 | ||||
-rw-r--r-- | host/lib/usrp/x300/x300_radio_ctrl_impl.cpp | 6 |
2 files changed, 9 insertions, 11 deletions
diff --git a/host/lib/rfnoc/legacy_compat.cpp b/host/lib/rfnoc/legacy_compat.cpp index f794b1c5a..b0fa42d3b 100644 --- a/host/lib/rfnoc/legacy_compat.cpp +++ b/host/lib/rfnoc/legacy_compat.cpp @@ -184,9 +184,7 @@ public: } } - const double tick_rate = - _tree->access<double>(mb_root(mboard) / "tick_rate").get(); - update_tick_rate_on_blocks(tick_rate, mboard); + update_sample_rate_on_blocks(mboard); } } @@ -353,7 +351,12 @@ public: void set_tick_rate(const double tick_rate, const size_t mboard_idx = 0) { _tree->access<double>(mb_root(mboard_idx) / "tick_rate").set(tick_rate); - update_tick_rate_on_blocks(tick_rate, mboard_idx); + for (size_t radio = 0; radio < _num_radios_per_board; radio++) { + auto radio_block_ctrl = + get_block_ctrl<radio_ctrl>(mboard_idx, "Radio", radio); + radio_block_ctrl->set_rate(tick_rate); + } + update_sample_rate_on_blocks(mboard_idx); } void set_rx_rate(const double rate, const size_t chan) @@ -1095,7 +1098,7 @@ private: // methods return subdev_spec; } - void update_tick_rate_on_blocks(const double tick_rate, const size_t mboard_idx) + void update_sample_rate_on_blocks(const size_t mboard_idx) { block_id_t radio_block_id(mboard_idx, RADIO_BLOCK_NAME); block_id_t duc_block_id(mboard_idx, DUC_BLOCK_NAME); @@ -1107,7 +1110,6 @@ private: // methods ddc_block_id.set_block_count(radio); radio_ctrl::sptr radio_sptr = _device->get_block_ctrl<radio_ctrl>(radio_block_id); - radio_sptr->set_rate(tick_rate); for (size_t chan = 0; chan < _num_rx_chans_per_radio and _has_ddcs; chan++) { const double radio_output_rate = radio_sptr->get_output_samp_rate(chan); _device->get_block_ctrl(ddc_block_id) diff --git a/host/lib/usrp/x300/x300_radio_ctrl_impl.cpp b/host/lib/usrp/x300/x300_radio_ctrl_impl.cpp index 9057180e4..76971a76e 100644 --- a/host/lib/usrp/x300/x300_radio_ctrl_impl.cpp +++ b/host/lib/usrp/x300/x300_radio_ctrl_impl.cpp @@ -903,11 +903,7 @@ void x300_radio_ctrl_impl::setup_radio(uhd::i2c_iface::sptr zpu_i2c, //////////////////////////////////////////////////////////////// // Set tick rate //////////////////////////////////////////////////////////////// - const double tick_rate = get_output_samp_rate(0); - if (_radio_type == PRIMARY) { - // Slot A is the highlander timekeeper - _tree->access<double>("tick_rate").set(tick_rate); - } + const double tick_rate = _tree->access<double>("tick_rate").get(); radio_ctrl_impl::set_rate(tick_rate); } |