aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/simple_device.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'host/lib/simple_device.cpp')
-rw-r--r--host/lib/simple_device.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/host/lib/simple_device.cpp b/host/lib/simple_device.cpp
index 63a17c52d..76f3c1262 100644
--- a/host/lib/simple_device.cpp
+++ b/host/lib/simple_device.cpp
@@ -179,7 +179,12 @@ public:
return get_xx_rates(_rx_ddc[std::string("decims")], _rx_ddc[std::string("rate")]);
}
- tune_result_t set_rx_freq(double target_freq, double lo_offset){
+ tune_result_t set_rx_freq(double target_freq){
+ double lo_offset = 0.0;
+ //if the local oscillator will be in the passband, use an offset
+ if (wax::cast<bool>(_rx_subdev[SUBDEV_PROP_LO_INTERFERES])){
+ lo_offset = get_rx_rate()*2.0;
+ }
return tune(target_freq, lo_offset, _rx_subdev, _rx_ddc, false/* not tx */);
}
@@ -242,7 +247,12 @@ public:
return get_xx_rates(_tx_duc[std::string("interps")], _tx_duc[std::string("rate")]);
}
- tune_result_t set_tx_freq(double target_freq, double lo_offset){
+ tune_result_t set_tx_freq(double target_freq){
+ double lo_offset = 0.0;
+ //if the local oscillator will be in the passband, use an offset
+ if (wax::cast<bool>(_tx_subdev[SUBDEV_PROP_LO_INTERFERES])){
+ lo_offset = get_tx_rate()*2.0;
+ }
return tune(target_freq, lo_offset, _tx_subdev, _tx_duc, true/* is tx */);
}