aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/dboard/db_xcvr2450.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'host/lib/usrp/dboard/db_xcvr2450.cpp')
-rw-r--r--host/lib/usrp/dboard/db_xcvr2450.cpp22
1 files changed, 8 insertions, 14 deletions
diff --git a/host/lib/usrp/dboard/db_xcvr2450.cpp b/host/lib/usrp/dboard/db_xcvr2450.cpp
index be0e42b92..d3084b0a0 100644
--- a/host/lib/usrp/dboard/db_xcvr2450.cpp
+++ b/host/lib/usrp/dboard/db_xcvr2450.cpp
@@ -72,8 +72,10 @@ using namespace boost::assign;
**********************************************************************/
static const bool xcvr2450_debug = false;
-static const freq_range_t xcvr_freq_range(2.4e9, 6.0e9);
-static const freq_range_t xcvr_freq_band_seperation(2.5e9, 4.9e9);
+static const freq_range_t xcvr_freq_range = list_of
+ (range_t<double>(2.4e9, 2.5e9))
+ (range_t<double>(4.9e9, 6.0e9))
+;
static const prop_names_t xcvr_antennas = list_of("J1")("J2");
@@ -212,10 +214,10 @@ xcvr2450::xcvr2450(ctor_args_t args) : xcvr_dboard_base(args){
set_rx_ant(xcvr_antennas.at(0));
set_tx_ant(xcvr_antennas.at(1));
BOOST_FOREACH(const std::string &name, xcvr_tx_gain_ranges.keys()){
- set_tx_gain(xcvr_tx_gain_ranges[name].min, name);
+ set_tx_gain(xcvr_tx_gain_ranges[name].start(), name);
}
BOOST_FOREACH(const std::string &name, xcvr_rx_gain_ranges.keys()){
- set_rx_gain(xcvr_rx_gain_ranges[name].min, name);
+ set_rx_gain(xcvr_rx_gain_ranges[name].start(), name);
}
}
@@ -259,17 +261,9 @@ void xcvr2450::update_atr(void){
* Tuning
**********************************************************************/
void xcvr2450::set_lo_freq(double target_freq){
- //clip for highband and lowband
- if((target_freq > xcvr_freq_band_seperation.min) and (target_freq < xcvr_freq_band_seperation.max)){
- if(target_freq - xcvr_freq_band_seperation.min < xcvr_freq_band_seperation.max - target_freq){
- target_freq = xcvr_freq_band_seperation.min;
- }else{
- target_freq = xcvr_freq_band_seperation.max;
- }
- }
- //clip for max and min
- target_freq = std::clip(target_freq, xcvr_freq_range.min, xcvr_freq_range.max);
+ //clip the input to the range (TODO FIXME not right)
+ target_freq = std::clip(target_freq, xcvr_freq_range.start(), xcvr_freq_range.stop());
//variables used in the calculation below
double scaler = xcvr2450::is_highband(target_freq)? (4.0/5.0) : (4.0/3.0);