aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2012-01-04 20:44:44 -0800
committerJosh Blum <josh@joshknows.com>2012-01-05 15:53:35 -0800
commit607b9a360067727a849d3088d5efa531192411e2 (patch)
tree371b82c55fcc18bd3bcb5451ef68ba8e942ed70b /host/lib/usrp
parent1c76adac7a5f4caa2ab07bc451b156980258130c (diff)
downloaduhd-607b9a360067727a849d3088d5efa531192411e2.tar.gz
uhd-607b9a360067727a849d3088d5efa531192411e2.tar.bz2
uhd-607b9a360067727a849d3088d5efa531192411e2.zip
sbx: fix dboard tuning to cache result
Diffstat (limited to 'host/lib/usrp')
-rw-r--r--host/lib/usrp/dboard/db_sbx_common.cpp14
-rw-r--r--host/lib/usrp/dboard/db_sbx_common.hpp2
-rw-r--r--host/lib/usrp/dboard/db_wbx_common.cpp4
-rw-r--r--host/lib/usrp/dboard/db_wbx_common.hpp8
4 files changed, 5 insertions, 23 deletions
diff --git a/host/lib/usrp/dboard/db_sbx_common.cpp b/host/lib/usrp/dboard/db_sbx_common.cpp
index 32b6730d5..d9a922896 100644
--- a/host/lib/usrp/dboard/db_sbx_common.cpp
+++ b/host/lib/usrp/dboard/db_sbx_common.cpp
@@ -273,16 +273,12 @@ void sbx_xcvr::set_tx_ant(const std::string &ant){
/***********************************************************************
* Tuning
**********************************************************************/
-void sbx_xcvr::set_rx_lo_freq(double freq){
- _rx_lo_freq = db_actual->set_lo_freq(dboard_iface::UNIT_RX, freq);
-}
-
-void sbx_xcvr::set_tx_lo_freq(double freq){
- _tx_lo_freq = db_actual->set_lo_freq(dboard_iface::UNIT_TX, freq);
-}
-
double sbx_xcvr::set_lo_freq(dboard_iface::unit_t unit, double target_freq) {
- return db_actual->set_lo_freq(unit, target_freq);
+ const double actual = db_actual->set_lo_freq(unit, target_freq);
+ if (unit == dboard_iface::UNIT_RX) _rx_lo_freq = actual;
+ if (unit == dboard_iface::UNIT_TX) _tx_lo_freq = actual;
+ update_atr();
+ return actual;
}
sensor_value_t sbx_xcvr::get_locked(dboard_iface::unit_t unit) {
diff --git a/host/lib/usrp/dboard/db_sbx_common.hpp b/host/lib/usrp/dboard/db_sbx_common.hpp
index b3e55c209..2f3939f2b 100644
--- a/host/lib/usrp/dboard/db_sbx_common.hpp
+++ b/host/lib/usrp/dboard/db_sbx_common.hpp
@@ -139,8 +139,6 @@ protected:
double _rx_lo_freq, _tx_lo_freq;
std::string _tx_ant, _rx_ant;
- void set_rx_lo_freq(double freq);
- void set_tx_lo_freq(double freq);
void set_rx_ant(const std::string &ant);
void set_tx_ant(const std::string &ant);
double set_rx_gain(double gain, const std::string &name);
diff --git a/host/lib/usrp/dboard/db_wbx_common.cpp b/host/lib/usrp/dboard/db_wbx_common.cpp
index daf6dbc98..58ce03d79 100644
--- a/host/lib/usrp/dboard/db_wbx_common.cpp
+++ b/host/lib/usrp/dboard/db_wbx_common.cpp
@@ -146,10 +146,6 @@ double wbx_base::set_rx_gain(double gain, const std::string &name){
/***********************************************************************
* Tuning
**********************************************************************/
-double wbx_base::set_lo_freq(dboard_iface::unit_t unit, double target_freq) {
- return db_actual->set_lo_freq(unit, target_freq);
-}
-
sensor_value_t wbx_base::get_locked(dboard_iface::unit_t unit){
const bool locked = (this->get_iface()->read_gpio(unit) & LOCKDET_MASK) != 0;
return sensor_value_t("LO", locked, "locked", "unlocked");
diff --git a/host/lib/usrp/dboard/db_wbx_common.hpp b/host/lib/usrp/dboard/db_wbx_common.hpp
index e7eb3f31a..9e984dce7 100644
--- a/host/lib/usrp/dboard/db_wbx_common.hpp
+++ b/host/lib/usrp/dboard/db_wbx_common.hpp
@@ -101,14 +101,6 @@ protected:
virtual void set_rx_enabled(bool enb);
/*!
- * Set the LO frequency for the particular dboard unit.
- * \param unit which unit rx or tx
- * \param target_freq the desired frequency in Hz
- * \return the actual frequency in Hz
- */
- virtual double set_lo_freq(dboard_iface::unit_t unit, double target_freq);
-
- /*!
* Get the lock detect status of the LO.
*
* This operation is identical for all versions of the WBX board.