From 7a1a37fbf6a4750cf3c6b2e2ba492eb47ed28daa Mon Sep 17 00:00:00 2001 From: AlexandreRouma Date: Fri, 20 Jan 2023 23:43:46 +0100 Subject: [PATCH] Fixed broken bandwidth options --- source_modules/usrp_source/src/main.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/source_modules/usrp_source/src/main.cpp b/source_modules/usrp_source/src/main.cpp index 3ddaedd8..99057faa 100644 --- a/source_modules/usrp_source/src/main.cpp +++ b/source_modules/usrp_source/src/main.cpp @@ -164,14 +164,9 @@ public: bandwidths.define(0, "Auto", 0); uhd::meta_range_t bwRange = dev->get_rx_bandwidth_range(chanId); for (const auto& r : bwRange) { - // If a single value, add it to the list - if (r.step() == 0.0 || r.start() == r.stop()) { - bandwidths.define((int)r.start(), getBandwdithScaled(r.start()), r.start()); - continue; - } - // Otherwise, save all entries to the list - for (double i = r.start(); i <= r.stop(); i += r.step()) { + double step = (r.step() == 0.0) ? 100e3 : r.step(); + for (double i = r.start(); i <= r.stop(); i += step) { bandwidths.define((int)i, getBandwdithScaled(i), i); } }