diff options
author | Nick Foster <nick@nerdnetworks.org> | 2010-09-29 18:27:08 -0700 |
---|---|---|
committer | Nick Foster <nick@nerdnetworks.org> | 2010-09-29 18:27:08 -0700 |
commit | 56751efbe6e0751a2b8cd0f7a31d5dfd07fec5dd (patch) | |
tree | c0276e51f4ba46193dbddf3e1441787d918d7681 /host/lib/usrp/dboard | |
parent | 9c58df56e805cc924aef980f466cd45a42b2d1a4 (diff) | |
download | uhd-56751efbe6e0751a2b8cd0f7a31d5dfd07fec5dd.tar.gz uhd-56751efbe6e0751a2b8cd0f7a31d5dfd07fec5dd.tar.bz2 uhd-56751efbe6e0751a2b8cd0f7a31d5dfd07fec5dd.zip |
TVRX: works for USRP and USRP2.
Diffstat (limited to 'host/lib/usrp/dboard')
-rw-r--r-- | host/lib/usrp/dboard/db_tvrx.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/host/lib/usrp/dboard/db_tvrx.cpp b/host/lib/usrp/dboard/db_tvrx.cpp index 71aff1680..6b71a3c6e 100644 --- a/host/lib/usrp/dboard/db_tvrx.cpp +++ b/host/lib/usrp/dboard/db_tvrx.cpp @@ -377,6 +377,7 @@ void tvrx::set_freq(double freq) { **********************************************************************/ void tvrx::rx_get(const wax::obj &key_, wax::obj &val){ named_prop_t key = named_prop_t::extract(key_); + int codec_rate; //handle the get request conditioned on the key switch(key.as<subdev_prop_t>()){ @@ -403,7 +404,15 @@ void tvrx::rx_get(const wax::obj &key_, wax::obj &val){ return; case SUBDEV_PROP_FREQ: - val = _lo_freq; + /* + * so here we have to do some magic. because the TVRX uses a relatively high IF, + * we have to watch the sample rate to see if the IF will be aliased + * or if it will fall within Nyquist. + */ + codec_rate = this->get_iface()->get_codec_rate(dboard_iface::UNIT_RX); + if(codec_rate/2 > tvrx_if_freq) val = _lo_freq; + //ok take a deep breath i am positive there is an easier way to get this number + else val = _lo_freq - tvrx_if_freq - (tvrx_if_freq-codec_rate)*int(tvrx_if_freq / (codec_rate/2)); return; case SUBDEV_PROP_FREQ_RANGE: |