aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib
diff options
context:
space:
mode:
Diffstat (limited to 'host/lib')
-rw-r--r--host/lib/rfnoc/block_container.cpp5
-rw-r--r--host/lib/usrp/multi_usrp_rfnoc.cpp37
2 files changed, 7 insertions, 35 deletions
diff --git a/host/lib/rfnoc/block_container.cpp b/host/lib/rfnoc/block_container.cpp
index e7fd396ba..5b68134ab 100644
--- a/host/lib/rfnoc/block_container.cpp
+++ b/host/lib/rfnoc/block_container.cpp
@@ -48,6 +48,11 @@ std::vector<block_id_t> block_container_t::find_blocks(
block_ids.push_back(id);
}
}
+ std::sort(block_ids.begin(),
+ block_ids.end(),
+ [](const uhd::rfnoc::block_id_t& i, const uhd::rfnoc::block_id_t& j) {
+ return i < j;
+ });
return block_ids;
}
diff --git a/host/lib/usrp/multi_usrp_rfnoc.cpp b/host/lib/usrp/multi_usrp_rfnoc.cpp
index 5242da965..99c07dc8c 100644
--- a/host/lib/usrp/multi_usrp_rfnoc.cpp
+++ b/host/lib/usrp/multi_usrp_rfnoc.cpp
@@ -96,20 +96,9 @@ public:
multi_usrp_rfnoc(rfnoc_graph::sptr graph, const device_addr_t& addr)
: _args(addr), _graph(graph), _tree(_graph->get_tree())
{
- // Discover all of the radios on our devices and create a mapping between radio
- // chains and channel numbers
+ // Discover all of the radios on our devices and create a mapping between
+ // radio chains and channel numbers. The result is sorted.
auto radio_blk_ids = _graph->find_blocks("Radio");
- // find_blocks doesn't sort, so we need to
- std::sort(radio_blk_ids.begin(),
- radio_blk_ids.end(),
- [](uhd::rfnoc::block_id_t i, uhd::rfnoc::block_id_t j) -> bool {
- if (i.get_device_no() != j.get_device_no()) {
- return i.get_device_no() < j.get_device_no();
- } else {
- return i.get_block_count() < j.get_block_count();
- }
- });
-
// If we don't find any radios, we don't have a multi_usrp object
if (radio_blk_ids.empty()) {
throw uhd::runtime_error(
@@ -895,17 +884,6 @@ public:
// Discover all of the radios on our devices and create a mapping between radio
// chains and channel numbers
auto radio_blk_ids = _graph->find_blocks(std::to_string(mboard) + "/Radio");
- // find_blocks doesn't sort, so we need to
- std::sort(radio_blk_ids.begin(),
- radio_blk_ids.end(),
- [](uhd::rfnoc::block_id_t i, uhd::rfnoc::block_id_t j) -> bool {
- if (i.get_device_no() != j.get_device_no()) {
- return i.get_device_no() < j.get_device_no();
- } else {
- return i.get_block_count() < j.get_block_count();
- }
- });
-
// If we don't find any radios, we don't have a multi_usrp object
if (radio_blk_ids.empty()) {
throw uhd::runtime_error(
@@ -1515,17 +1493,6 @@ public:
// Discover all of the radios on our devices and create a mapping between radio
// chains and channel numbers
auto radio_blk_ids = _graph->find_blocks(std::to_string(mboard) + "/Radio");
- // find_blocks doesn't sort, so we need to
- std::sort(radio_blk_ids.begin(),
- radio_blk_ids.end(),
- [](uhd::rfnoc::block_id_t i, uhd::rfnoc::block_id_t j) -> bool {
- if (i.get_device_no() != j.get_device_no()) {
- return i.get_device_no() < j.get_device_no();
- } else {
- return i.get_block_count() < j.get_block_count();
- }
- });
-
// If we don't find any radios, we don't have a multi_usrp object
if (radio_blk_ids.empty()) {
throw uhd::runtime_error(