diff options
author | Josh Blum <josh@joshknows.com> | 2011-11-10 17:29:18 -0800 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2011-11-10 17:29:18 -0800 |
commit | 3cb60c974fff6779396294fd456904d1f6addd71 (patch) | |
tree | 32cc650d14243bd60c054a6ca475d30711a4c4fe /host/lib | |
parent | bb2259e05f03ddffe7b789c4aa16d86e4cfa575c (diff) | |
download | uhd-3cb60c974fff6779396294fd456904d1f6addd71.tar.gz uhd-3cb60c974fff6779396294fd456904d1f6addd71.tar.bz2 uhd-3cb60c974fff6779396294fd456904d1f6addd71.zip |
uhd: basically usable cal sweep for wbx
Diffstat (limited to 'host/lib')
-rw-r--r-- | host/lib/usrp/cores/rx_frontend_core_200.cpp | 4 | ||||
-rw-r--r-- | host/lib/usrp/cores/tx_frontend_core_200.cpp | 4 | ||||
-rw-r--r-- | host/lib/usrp/multi_usrp.cpp | 11 |
3 files changed, 12 insertions, 7 deletions
diff --git a/host/lib/usrp/cores/rx_frontend_core_200.cpp b/host/lib/usrp/cores/rx_frontend_core_200.cpp index d42022947..d6396ef45 100644 --- a/host/lib/usrp/cores/rx_frontend_core_200.cpp +++ b/host/lib/usrp/cores/rx_frontend_core_200.cpp @@ -64,8 +64,8 @@ public: } void set_iq_balance(const std::complex<double> &cor){ - _iface->poke32(REG_RX_FE_MAG_CORRECTION, fs_to_bits(std::abs(cor), 18)); - _iface->poke32(REG_RX_FE_PHASE_CORRECTION, fs_to_bits(std::atan2(cor.real(), cor.imag()), 18)); + _iface->poke32(REG_RX_FE_MAG_CORRECTION, fs_to_bits(std::abs(cor) - 1, 18)); + _iface->poke32(REG_RX_FE_PHASE_CORRECTION, fs_to_bits(std::arg(cor)/6.28318531, 18)); } private: diff --git a/host/lib/usrp/cores/tx_frontend_core_200.cpp b/host/lib/usrp/cores/tx_frontend_core_200.cpp index 327e8d344..b90281d9f 100644 --- a/host/lib/usrp/cores/tx_frontend_core_200.cpp +++ b/host/lib/usrp/cores/tx_frontend_core_200.cpp @@ -62,8 +62,8 @@ public: } void set_iq_balance(const std::complex<double> &cor){ - _iface->poke32(REG_TX_FE_MAG_CORRECTION, fs_to_bits(std::abs(cor), 18)); - _iface->poke32(REG_TX_FE_PHASE_CORRECTION, fs_to_bits(std::atan2(cor.real(), cor.imag()), 18)); + _iface->poke32(REG_TX_FE_MAG_CORRECTION, fs_to_bits(std::abs(cor) - 1, 18)); + _iface->poke32(REG_TX_FE_PHASE_CORRECTION, fs_to_bits(std::arg(cor)/6.28318531, 18)); } private: diff --git a/host/lib/usrp/multi_usrp.cpp b/host/lib/usrp/multi_usrp.cpp index 1110f5ebd..6fd60fb6f 100644 --- a/host/lib/usrp/multi_usrp.cpp +++ b/host/lib/usrp/multi_usrp.cpp @@ -50,10 +50,15 @@ static void do_samp_rate_warning_message( } static void do_tune_freq_warning_message( - double target_freq, + const tune_request_t &tune_req, double actual_freq, const std::string &xx ){ + //forget the warning when manual policy + if (tune_req.dsp_freq_policy == tune_request_t::POLICY_MANUAL) return; + if (tune_req.rf_freq_policy == tune_request_t::POLICY_MANUAL) return; + + const double target_freq = tune_req.target_freq; static const double max_allowed_error = 1.0; //Hz if (std::abs(target_freq - actual_freq) > max_allowed_error){ UHD_MSG(warning) << boost::format( @@ -486,7 +491,7 @@ public: tune_result_t set_rx_freq(const tune_request_t &tune_request, size_t chan){ tune_result_t r = tune_xx_subdev_and_dsp(RX_SIGN, _tree->subtree(rx_dsp_root(chan)), _tree->subtree(rx_rf_fe_root(chan)), tune_request); - do_tune_freq_warning_message(tune_request.target_freq, get_rx_freq(chan), "RX"); + do_tune_freq_warning_message(tune_request, get_rx_freq(chan), "RX"); return r; } @@ -634,7 +639,7 @@ public: tune_result_t set_tx_freq(const tune_request_t &tune_request, size_t chan){ tune_result_t r = tune_xx_subdev_and_dsp(TX_SIGN, _tree->subtree(tx_dsp_root(chan)), _tree->subtree(tx_rf_fe_root(chan)), tune_request); - do_tune_freq_warning_message(tune_request.target_freq, get_tx_freq(chan), "TX"); + do_tune_freq_warning_message(tune_request, get_tx_freq(chan), "TX"); return r; } |