From 4185493a016eb69e2b78d6fd20101ace7c44064f Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Tue, 6 Jul 2021 17:42:54 +0200 Subject: dbsrx: Fix issue with loop variable In 26cc208, we accidentally added an `auto` into a loop, making the loop variable's scope local. However, this variable lives outside this for loop. --- host/lib/usrp/dboard/db_dbsrx.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'host') diff --git a/host/lib/usrp/dboard/db_dbsrx.cpp b/host/lib/usrp/dboard/db_dbsrx.cpp index 09690a3d1..ef8554f86 100644 --- a/host/lib/usrp/dboard/db_dbsrx.cpp +++ b/host/lib/usrp/dboard/db_dbsrx.cpp @@ -272,7 +272,8 @@ double dbsrx::set_lo_freq(double target_freq) std::vector clock_rates = this->get_iface()->get_clock_rates(dboard_iface::UNIT_RX); const double max_clock_rate = uhd::sorted(clock_rates).back(); - for (auto ref_clock : uhd::reversed(uhd::sorted(clock_rates))) { + for (auto ref_clock_it : uhd::reversed(uhd::sorted(clock_rates))) { + ref_clock = ref_clock_it; // USRP1 feeds the DBSRX clock from a FPGA GPIO line. // make sure that this clock does not exceed rate limit. if (this->get_iface()->get_special_props().soft_clock_divider) { @@ -298,10 +299,10 @@ double dbsrx::set_lo_freq(double target_freq) continue; // choose R - for (auto r = 0; r <= 6; r += 1) { + for (r = 0; r <= 6; r += 1) { // compute divider from setting R = 1 << (r + 1); - UHD_LOGGER_TRACE("DBSRX") << boost::format("DBSRX R:%d\n") % R; + UHD_LOGGER_TRACE("DBSRX") << "DBSRX R:" << R << "\n"; // compute PFD compare frequency = ref_clock/R pfd_freq = ref_clock / R; -- cgit v1.2.3