From a09700c26a39ebddbeb56b5ecddedf50f0cc7ac4 Mon Sep 17 00:00:00 2001 From: jcorgan Date: Fri, 26 Dec 2008 19:31:44 +0000 Subject: Fix missing set_bw call in new daughterboard API. Reconciled implementations between different boards to return true or false (success). git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@10168 221aa14e-8319-0410-a670-987f0aec2ac5 --- usrp/host/lib/legacy/db_dbs_rx.cc | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'usrp/host/lib/legacy/db_dbs_rx.cc') diff --git a/usrp/host/lib/legacy/db_dbs_rx.cc b/usrp/host/lib/legacy/db_dbs_rx.cc index 5f3b32f92..d98838a4a 100644 --- a/usrp/host/lib/legacy/db_dbs_rx.cc +++ b/usrp/host/lib/legacy/db_dbs_rx.cc @@ -150,12 +150,15 @@ db_dbs_rx::_set_fdac(int fdac) _send_reg(3); } -struct bw_t +bool db_dbs_rx::set_bw (float bw) { - assert(bw>=1e6 && bw<=33e6); + if (bw < 1e6 || bw > 33e6) { + fprintf(stderr, "db_dbs_rx::set_bw: bw (=%f) must be between 1e6 and 33e6 inclusive\n", bw); + return false; + } - struct bw_t ret = {0, 0, 0}; + // struct bw_t ret = {0, 0, 0}; int m_max, m_min, m_test, fdac_test; if(bw >= 4e6) m_max = int(std::min(31, (int)floor(_refclk_freq()/1e6))); @@ -178,14 +181,16 @@ db_dbs_rx::set_bw (float bw) _set_m(m_test); _set_fdac(fdac_test); - ret.m = d_m; - ret.fdac = d_fdac; - ret.div = _refclk_freq()/d_m*(4+0.145*d_fdac); + //ret.m = d_m; + //ret.fdac = d_fdac; + //ret.div = _refclk_freq()/d_m*(4+0.145*d_fdac); } else { - fprintf(stderr, "Failed to set bw\n"); + fprintf(stderr, "db_dbs_rx::set_bw: failed\n"); + return false; } - return ret; + + return true; } // Gain setting -- cgit