diff options
author | jcorgan | 2008-12-26 19:31:44 +0000 |
---|---|---|
committer | jcorgan | 2008-12-26 19:31:44 +0000 |
commit | a09700c26a39ebddbeb56b5ecddedf50f0cc7ac4 (patch) | |
tree | ab0965177ca1e3a30e6a4ba0335bf8d9acc86531 /usrp/host/lib/legacy/db_dbs_rx.cc | |
parent | d755f1395daf64f3a75d5947cd71b0a61b099392 (diff) | |
download | gnuradio-a09700c26a39ebddbeb56b5ecddedf50f0cc7ac4.tar.gz gnuradio-a09700c26a39ebddbeb56b5ecddedf50f0cc7ac4.tar.bz2 gnuradio-a09700c26a39ebddbeb56b5ecddedf50f0cc7ac4.zip |
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
Diffstat (limited to 'usrp/host/lib/legacy/db_dbs_rx.cc')
-rw-r--r-- | usrp/host/lib/legacy/db_dbs_rx.cc | 21 |
1 files changed, 13 insertions, 8 deletions
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 |