summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Abele <jason@ettus.com>2011-11-08 11:02:48 -0800
committerJosh Blum <josh@joshknows.com>2011-11-08 11:15:34 -0800
commit0ea2683862fedf27d23ee2ad23e119edc1bf610c (patch)
tree41480fd17b42e5c830fcd8f0b7b330884f2ee954
parent7749b0f0651733aa5962d5b577f483d37d125e24 (diff)
downloaduhd-0ea2683862fedf27d23ee2ad23e119edc1bf610c.tar.gz
uhd-0ea2683862fedf27d23ee2ad23e119edc1bf610c.tar.bz2
uhd-0ea2683862fedf27d23ee2ad23e119edc1bf610c.zip
Clip WBX target freq before computing LO settings
-rw-r--r--host/lib/usrp/dboard/db_wbx_version2.cpp3
-rw-r--r--host/lib/usrp/dboard/db_wbx_version3.cpp3
-rw-r--r--host/lib/usrp/dboard/db_wbx_version4.cpp3
3 files changed, 9 insertions, 0 deletions
diff --git a/host/lib/usrp/dboard/db_wbx_version2.cpp b/host/lib/usrp/dboard/db_wbx_version2.cpp
index e25cb2e4c..ad31339e7 100644
--- a/host/lib/usrp/dboard/db_wbx_version2.cpp
+++ b/host/lib/usrp/dboard/db_wbx_version2.cpp
@@ -159,6 +159,9 @@ double wbx_base::wbx_version2::set_tx_gain(double gain, const std::string &name)
* Tuning
**********************************************************************/
double wbx_base::wbx_version2::set_lo_freq(dboard_iface::unit_t unit, double target_freq) {
+ //clip to tuning range
+ target_freq = wbx_v2_freq_range.clip(target_freq);
+
UHD_LOGV(often) << boost::format(
"WBX tune: target frequency %f Mhz"
) % (target_freq/1e6) << std::endl;
diff --git a/host/lib/usrp/dboard/db_wbx_version3.cpp b/host/lib/usrp/dboard/db_wbx_version3.cpp
index 70981ce94..1e7e448fa 100644
--- a/host/lib/usrp/dboard/db_wbx_version3.cpp
+++ b/host/lib/usrp/dboard/db_wbx_version3.cpp
@@ -166,6 +166,9 @@ double wbx_base::wbx_version3::set_tx_gain(double gain, const std::string &name)
* Tuning
**********************************************************************/
double wbx_base::wbx_version3::set_lo_freq(dboard_iface::unit_t unit, double target_freq) {
+ //clip to tuning range
+ target_freq = wbx_v3_freq_range.clip(target_freq);
+
UHD_LOGV(often) << boost::format(
"WBX tune: target frequency %f Mhz"
) % (target_freq/1e6) << std::endl;
diff --git a/host/lib/usrp/dboard/db_wbx_version4.cpp b/host/lib/usrp/dboard/db_wbx_version4.cpp
index faaf9e3fd..cebaee2d7 100644
--- a/host/lib/usrp/dboard/db_wbx_version4.cpp
+++ b/host/lib/usrp/dboard/db_wbx_version4.cpp
@@ -167,6 +167,9 @@ double wbx_base::wbx_version4::set_tx_gain(double gain, const std::string &name)
* Tuning
**********************************************************************/
double wbx_base::wbx_version4::set_lo_freq(dboard_iface::unit_t unit, double target_freq) {
+ //clip to tuning range
+ target_freq = wbx_v4_freq_range.clip(target_freq);
+
UHD_LOGV(often) << boost::format(
"WBX tune: target frequency %f Mhz"
) % (target_freq/1e6) << std::endl;