From 0d42e860985ce1744d4c3fa41a1c123575eaa2f8 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Tue, 15 Nov 2016 12:13:43 -0800 Subject: rfnoc: legacy_compat gets its own set_{rx,tx}_rate() calls This avoids double-calling subscribers, and will fix the case where a rate change in a multi-channel scenario will break because the graph resolution is done before all rates are set. --- host/lib/usrp/multi_usrp.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'host/lib/usrp/multi_usrp.cpp') diff --git a/host/lib/usrp/multi_usrp.cpp b/host/lib/usrp/multi_usrp.cpp index 7c3bf8007..058925a9a 100644 --- a/host/lib/usrp/multi_usrp.cpp +++ b/host/lib/usrp/multi_usrp.cpp @@ -815,6 +815,18 @@ public: } void set_rx_rate(double rate, size_t chan){ + if (is_device3()) { + _legacy_compat->set_rx_rate(rate, chan); + if (chan == ALL_CHANS) { + for (size_t c = 0; c < get_rx_num_channels(); c++){ + do_samp_rate_warning_message(rate, get_rx_rate(c), "RX"); + } + } else { + do_samp_rate_warning_message(rate, get_rx_rate(chan), "RX"); + } + return; + } + if (chan != ALL_CHANS){ _tree->access(rx_dsp_root(chan) / "rate" / "value").set(rate); do_samp_rate_warning_message(rate, get_rx_rate(chan), "RX"); @@ -1343,6 +1355,18 @@ public: } void set_tx_rate(double rate, size_t chan){ + if (is_device3()) { + _legacy_compat->set_tx_rate(rate, chan); + if (chan == ALL_CHANS) { + for (size_t c = 0; c < get_tx_num_channels(); c++){ + do_samp_rate_warning_message(rate, get_tx_rate(c), "TX"); + } + } else { + do_samp_rate_warning_message(rate, get_tx_rate(chan), "TX"); + } + return; + } + if (chan != ALL_CHANS){ _tree->access(tx_dsp_root(chan) / "rate" / "value").set(rate); do_samp_rate_warning_message(rate, get_tx_rate(chan), "TX"); -- cgit v1.2.3