aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/dboard/db_dbsrx.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_dbsrx.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_dbsrx.cpp')
-rw-r--r--host/lib/usrp/dboard/db_dbsrx.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/host/lib/usrp/dboard/db_dbsrx.cpp b/host/lib/usrp/dboard/db_dbsrx.cpp
index 70bf03158..5316fb952 100644
--- a/host/lib/usrp/dboard/db_dbsrx.cpp
+++ b/host/lib/usrp/dboard/db_dbsrx.cpp
@@ -229,7 +229,7 @@ dbsrx::~dbsrx(void){
* Tuning
**********************************************************************/
void dbsrx::set_lo_freq(double target_freq){
- target_freq = std::clip(target_freq, dbsrx_freq_range.start(), dbsrx_freq_range.stop());
+ target_freq = dbsrx_freq_range.clip(target_freq);
double actual_freq=0.0, pfd_freq=0.0, ref_clock=0.0;
int R=0, N=0, r=0, m=0;
@@ -417,7 +417,7 @@ void dbsrx::set_lo_freq(double target_freq){
*/
static int gain_to_gc2_vga_reg(float &gain){
int reg = 0;
- gain = std::clip(gain, dbsrx_gain_ranges["GC2"].start(), dbsrx_gain_ranges["GC2"].stop());
+ gain = dbsrx_gain_ranges["GC2"].clip(gain);
// Half dB steps from 0-5dB, 1dB steps from 5-24dB
if (gain < 5) {
@@ -443,7 +443,7 @@ static int gain_to_gc2_vga_reg(float &gain){
*/
static float gain_to_gc1_rfvga_dac(float &gain){
//clip the input
- gain = std::clip(gain, dbsrx_gain_ranges["GC1"].start(), dbsrx_gain_ranges["GC1"].stop());
+ gain = dbsrx_gain_ranges["GC1"].clip(gain);
//voltage level constants
static const float max_volts = float(1.2), min_volts = float(2.7);