aboutsummaryrefslogtreecommitdiffstats
path: root/host
diff options
context:
space:
mode:
authorPhilip Balister <philip@opensdr.com>2010-08-18 23:59:58 +0000
committerPhilip Balister <philip@opensdr.com>2010-08-18 23:59:58 +0000
commitee20f8eb4f64d3fd8c34ef9cde5d125bd5a14816 (patch)
treedeeb4355d3cddedb1beca0d8abaa4e97bcdb1daf /host
parent6be4654073523d0666be552eee28445eb5f72297 (diff)
downloaduhd-ee20f8eb4f64d3fd8c34ef9cde5d125bd5a14816.tar.gz
uhd-ee20f8eb4f64d3fd8c34ef9cde5d125bd5a14816.tar.bz2
uhd-ee20f8eb4f64d3fd8c34ef9cde5d125bd5a14816.zip
Change TX PGA gain scaling to match gnuradio scaling
Diffstat (limited to 'host')
-rw-r--r--host/lib/usrp/usrp_e/codec_ctrl.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/host/lib/usrp/usrp_e/codec_ctrl.cpp b/host/lib/usrp/usrp_e/codec_ctrl.cpp
index 837219759..17262d358 100644
--- a/host/lib/usrp/usrp_e/codec_ctrl.cpp
+++ b/host/lib/usrp/usrp_e/codec_ctrl.cpp
@@ -134,8 +134,8 @@ usrp_e_codec_ctrl_impl::~usrp_e_codec_ctrl_impl(void){
* Codec Control Gain Control Methods
**********************************************************************/
void usrp_e_codec_ctrl_impl::set_tx_pga_gain(float gain){
- int gain_word = int(63*(gain - tx_pga_gain_range.min)/(tx_pga_gain_range.max - tx_pga_gain_range.min));
- _ad9862_regs.tx_pga_gain = std::clip(gain_word, 0, 63);
+ int gain_word = int(255*(gain - tx_pga_gain_range.min)/(tx_pga_gain_range.max - tx_pga_gain_range.min));
+ _ad9862_regs.tx_pga_gain = std::clip(gain_word, 0, 255);
this->send_reg(16);
}