aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/dboard/db_tvrx.cpp
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-11-01 20:57:09 -0700
committerJosh Blum <josh@joshknows.com>2010-11-10 19:29:06 -0800
commit775383e635cdf27ede64f5936a649570b74d7c70 (patch)
treee788ed4e04bafc6e82f1e610ab3113b5741a8ed0 /host/lib/usrp/dboard/db_tvrx.cpp
parent08dfff379865656e94b31fd565a4b13b4609ea63 (diff)
downloaduhd-775383e635cdf27ede64f5936a649570b74d7c70.tar.gz
uhd-775383e635cdf27ede64f5936a649570b74d7c70.tar.bz2
uhd-775383e635cdf27ede64f5936a649570b74d7c70.zip
uhd: added meta-range clip and implemented in dboards, fixed step calculation
Diffstat (limited to 'host/lib/usrp/dboard/db_tvrx.cpp')
-rw-r--r--host/lib/usrp/dboard/db_tvrx.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/host/lib/usrp/dboard/db_tvrx.cpp b/host/lib/usrp/dboard/db_tvrx.cpp
index 94ab86898..17fdad74a 100644
--- a/host/lib/usrp/dboard/db_tvrx.cpp
+++ b/host/lib/usrp/dboard/db_tvrx.cpp
@@ -277,7 +277,7 @@ static double gain_interp(double gain, boost::array<double, 17> db_vector, boost
static float rf_gain_to_voltage(float gain, double lo_freq){
//clip the input
- gain = std::clip(gain, get_tvrx_gain_ranges()["RF"].start(), get_tvrx_gain_ranges()["RF"].stop());
+ gain = get_tvrx_gain_ranges()["RF"].clip(gain);
//first we need to find out what band we're in, because gains are different across different bands
std::string band = get_band(lo_freq + tvrx_if_freq);
@@ -305,7 +305,7 @@ static float rf_gain_to_voltage(float gain, double lo_freq){
static float if_gain_to_voltage(float gain){
//clip the input
- gain = std::clip(gain, get_tvrx_gain_ranges()["IF"].start(), get_tvrx_gain_ranges()["IF"].stop());
+ gain = get_tvrx_gain_ranges()["IF"].clip(gain);
double gain_volts = gain_interp(gain, tvrx_if_gains_db, tvrx_gains_volts);
double dac_volts = gain_volts / opamp_gain;
@@ -337,7 +337,7 @@ void tvrx::set_gain(float gain, const std::string &name){
*/
void tvrx::set_freq(double freq) {
- freq = std::clip(freq, tvrx_freq_range.start(), tvrx_freq_range.stop());
+ freq = tvrx_freq_range.clip(freq);
std::string prev_band = get_band(_lo_freq - tvrx_if_freq);
std::string new_band = get_band(freq);