From 607b9a360067727a849d3088d5efa531192411e2 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Wed, 4 Jan 2012 20:44:44 -0800 Subject: sbx: fix dboard tuning to cache result --- host/lib/usrp/dboard/db_sbx_common.cpp | 14 +++++--------- host/lib/usrp/dboard/db_sbx_common.hpp | 2 -- host/lib/usrp/dboard/db_wbx_common.cpp | 4 ---- host/lib/usrp/dboard/db_wbx_common.hpp | 8 -------- 4 files changed, 5 insertions(+), 23 deletions(-) (limited to 'host/lib') 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 @@ -100,14 +100,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. * -- cgit v1.2.3