diff options
author | Josh Blum <josh@joshknows.com> | 2012-02-24 10:00:44 -0800 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2012-02-24 10:06:13 -0800 |
commit | 11e9429b9515f4e6315b867dbe2fcd17bd8a96a8 (patch) | |
tree | 7d3a55734588f6b25a232f888fe5af1c84a27085 /host | |
parent | 1156d9b26a59ae45ec34b2fcb7ac782f4bf03b40 (diff) | |
download | uhd-11e9429b9515f4e6315b867dbe2fcd17bd8a96a8.tar.gz uhd-11e9429b9515f4e6315b867dbe2fcd17bd8a96a8.tar.bz2 uhd-11e9429b9515f4e6315b867dbe2fcd17bd8a96a8.zip |
usrp1: fix to use the db connection type to determine DAC sign
Unlike the other products, usrp1 uses the DAC and not DSP
to perform baseband frequency shifting in the hardware.
Therefore this shifting occurs before I and Q swapping,
and so, the sign of the frequency needs to be inverted
on daughterboards which have inverted I and Q TX inputs.
Diffstat (limited to 'host')
-rw-r--r-- | host/lib/usrp/usrp1/io_impl.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/host/lib/usrp/usrp1/io_impl.cpp b/host/lib/usrp/usrp1/io_impl.cpp index ff2b6017f..d256df660 100644 --- a/host/lib/usrp/usrp1/io_impl.cpp +++ b/host/lib/usrp/usrp1/io_impl.cpp @@ -549,8 +549,16 @@ double usrp1_impl::update_rx_dsp_freq(const size_t dspno, const double freq_){ } double usrp1_impl::update_tx_dsp_freq(const size_t dspno, const double freq){ - //map the freq shift key to a subdev spec to a particular codec chip - _dbc[_tx_subdev_spec.at(dspno).db_name].codec->set_duc_freq(freq, _master_clock_rate); + const subdev_spec_pair_t pair = _tx_subdev_spec.at(dspno); + + //determine the connection type and hence, the sign + const std::string conn = _tree->access<std::string>(str(boost::format( + "/mboards/0/dboards/%s/tx_frontends/%s/connection" + ) % pair.db_name % pair.sd_name)).get(); + double sign = (conn == "I" or conn == "IQ")? +1.0 : -1.0; + + //map this DSP's subdev spec to a particular codec chip + _dbc[pair.db_name].codec->set_duc_freq(sign*freq, _master_clock_rate); return freq; //assume infinite precision } |