aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib
diff options
context:
space:
mode:
authorsteviez <steve.czabaniuk@ni.com>2020-04-08 02:10:02 -0500
committerAaron Rossetto <aaron.rossetto@ni.com>2020-04-13 07:19:12 -0500
commit26ff29348931389f7c7e8d78bc4c3630dfc8d342 (patch)
tree583c637f057e7f2812c7f4d3b94c740855df82bd /host/lib
parent722e944323c387f607d580ddfa2c5d9d2a1a76cc (diff)
downloaduhd-26ff29348931389f7c7e8d78bc4c3630dfc8d342.tar.gz
uhd-26ff29348931389f7c7e8d78bc4c3630dfc8d342.tar.bz2
uhd-26ff29348931389f7c7e8d78bc4c3630dfc8d342.zip
multi_usrp_rfnoc: Fix get_rx/tx_rates()
This replaces incorrect code with the proper function calls to retrieve the range of possible sample rates.
Diffstat (limited to 'host/lib')
-rw-r--r--host/lib/usrp/multi_usrp_rfnoc.cpp22
1 files changed, 10 insertions, 12 deletions
diff --git a/host/lib/usrp/multi_usrp_rfnoc.cpp b/host/lib/usrp/multi_usrp_rfnoc.cpp
index 11d5f28d1..0c716c0a3 100644
--- a/host/lib/usrp/multi_usrp_rfnoc.cpp
+++ b/host/lib/usrp/multi_usrp_rfnoc.cpp
@@ -1076,13 +1076,12 @@ public:
meta_range_t get_rx_rates(size_t chan)
{
+ std::lock_guard<std::recursive_mutex> l(_graph_mutex);
auto rx_chain = _get_rx_chan(chan);
- return (rx_chain.ddc)
- ? make_overall_tune_range(
- rx_chain.radio->get_rx_frequency_range(rx_chain.block_chan),
- rx_chain.ddc->get_frequency_range(rx_chain.block_chan),
- rx_chain.radio->get_rx_bandwidth(rx_chain.block_chan))
- : rx_chain.radio->get_rx_frequency_range(rx_chain.block_chan);
+ if (rx_chain.ddc) {
+ return rx_chain.ddc->get_output_rates(rx_chain.block_chan);
+ }
+ return rx_chain.radio->get_rate_range();
}
tune_result_t set_rx_freq(const tune_request_t& tune_request, size_t chan)
@@ -1655,13 +1654,12 @@ public:
meta_range_t get_tx_rates(size_t chan)
{
+ std::lock_guard<std::recursive_mutex> l(_graph_mutex);
auto tx_chain = _get_tx_chan(chan);
- return (tx_chain.duc)
- ? make_overall_tune_range(
- tx_chain.radio->get_tx_frequency_range(tx_chain.block_chan),
- tx_chain.duc->get_frequency_range(tx_chain.block_chan),
- tx_chain.radio->get_tx_bandwidth(tx_chain.block_chan))
- : tx_chain.radio->get_tx_frequency_range(tx_chain.block_chan);
+ if (tx_chain.duc) {
+ return tx_chain.duc->get_input_rates(tx_chain.block_chan);
+ }
+ return tx_chain.radio->get_rate_range();
}
tune_result_t set_tx_freq(const tune_request_t& tune_request, size_t chan)