diff options
author | Josh Blum <josh@joshknows.com> | 2013-07-19 14:45:24 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2013-07-19 14:45:24 -0700 |
commit | d251a7a55b198aa61ae05809c2e601a04fcb9b97 (patch) | |
tree | 8125a0fb523cefbe897c43001c0685578d2b0ca0 /host | |
parent | ae1459c7c6078727d7acfabb397db105da547a55 (diff) | |
download | uhd-d251a7a55b198aa61ae05809c2e601a04fcb9b97.tar.gz uhd-d251a7a55b198aa61ae05809c2e601a04fcb9b97.tar.bz2 uhd-d251a7a55b198aa61ae05809c2e601a04fcb9b97.zip |
b200: use existing query rate calls to clip
Diffstat (limited to 'host')
-rw-r--r-- | host/lib/usrp/b200/b200_impl.cpp | 5 | ||||
-rw-r--r-- | host/lib/usrp/common/ad9361_ctrl.cpp | 4 | ||||
-rw-r--r-- | host/lib/usrp/common/ad9361_ctrl.hpp | 6 |
3 files changed, 6 insertions, 9 deletions
diff --git a/host/lib/usrp/b200/b200_impl.cpp b/host/lib/usrp/b200/b200_impl.cpp index 01db182e0..68d2d5594 100644 --- a/host/lib/usrp/b200/b200_impl.cpp +++ b/host/lib/usrp/b200/b200_impl.cpp @@ -640,11 +640,8 @@ void b200_impl::codec_loopback_self_test(wb_iface::sptr iface) /*********************************************************************** * Sample and tick rate comprehension below **********************************************************************/ -double b200_impl::set_tick_rate(const double raw_rate) +double b200_impl::set_tick_rate(const double rate) { - //clip rate (which can be doubled by factor) to possible bounds - const double rate = ad9361_ctrl::get_samp_rate_range().clip(raw_rate); - UHD_MSG(status) << "Asking for clock rate " << rate/1e6 << " MHz\n"; _tick_rate = _codec_ctrl->set_clock_rate(rate); UHD_MSG(status) << "Actually got clock rate " << _tick_rate/1e6 << " MHz\n"; diff --git a/host/lib/usrp/common/ad9361_ctrl.cpp b/host/lib/usrp/common/ad9361_ctrl.cpp index ae7cc6f9b..eaac3c82f 100644 --- a/host/lib/usrp/common/ad9361_ctrl.cpp +++ b/host/lib/usrp/common/ad9361_ctrl.cpp @@ -64,7 +64,7 @@ struct ad9361_ctrl_impl : public ad9361_ctrl ) % (rate/1e6) % 56.0 << std::endl; //clip to known bounds - const meta_range_t clock_rate_range(250e3, 61.44e6); + const meta_range_t clock_rate_range = ad9361_ctrl::get_clock_rate_range(); const double clipped_rate = clock_rate_range.clip(rate); ad9361_transaction_t request; @@ -93,7 +93,7 @@ struct ad9361_ctrl_impl : public ad9361_ctrl double tune(const std::string &which, const double freq) { //clip to known bounds - const meta_range_t freq_range(50e6, 6e9); + const meta_range_t freq_range = ad9361_ctrl::get_rf_freq_range(); const double clipped_freq = freq_range.clip(freq); ad9361_transaction_t request; diff --git a/host/lib/usrp/common/ad9361_ctrl.hpp b/host/lib/usrp/common/ad9361_ctrl.hpp index 6d79ef3e9..e678ba3b0 100644 --- a/host/lib/usrp/common/ad9361_ctrl.hpp +++ b/host/lib/usrp/common/ad9361_ctrl.hpp @@ -87,7 +87,7 @@ public: //! get the freq range for the frontend which static uhd::meta_range_t get_rf_freq_range(void) { - return uhd::meta_range_t(30e6, 6e9); + return uhd::meta_range_t(50e6, 6e9); } //! get the filter range for the frontend which @@ -96,8 +96,8 @@ public: return uhd::meta_range_t(200e3, 56e6); } - //! get the filter range for the frontend which - static uhd::meta_range_t get_samp_rate_range(void) + //! get the clock rate range for the frontend + static uhd::meta_range_t get_clock_rate_range(void) { return uhd::meta_range_t(220e3, 61.44e6); } |