diff options
author | Trung Tran <trung.tran@ettus.com> | 2018-09-12 12:49:51 -0700 |
---|---|---|
committer | Brent Stapleton <bstapleton@g.hmc.edu> | 2018-09-14 16:34:51 -0700 |
commit | 786560decef09cff6e5db1c98fdb3de30cf10898 (patch) | |
tree | a525ef7a72ed88c2cd04135643538de441a216fb /host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_impl.cpp | |
parent | 5fadcfacd825ccc0f0e583d1f196d5e70cc52ed8 (diff) | |
download | uhd-786560decef09cff6e5db1c98fdb3de30cf10898.tar.gz uhd-786560decef09cff6e5db1c98fdb3de30cf10898.tar.bz2 uhd-786560decef09cff6e5db1c98fdb3de30cf10898.zip |
mg: clipping frequency
Clipping requested frequency to acceptable ranges in Magnesium TX/RX
set frequency functions.
Diffstat (limited to 'host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_impl.cpp')
-rw-r--r-- | host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_impl.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_impl.cpp b/host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_impl.cpp index 3fd32bda9..d27531a2b 100644 --- a/host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_impl.cpp +++ b/host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_impl.cpp @@ -206,10 +206,10 @@ void magnesium_radio_ctrl_impl::set_rx_antenna( } double magnesium_radio_ctrl_impl::set_tx_frequency( - const double freq, + const double req_freq, const size_t chan ) { - // FIXME bounds checking + clipping!!! + const double freq = MAGNESIUM_FREQ_RANGE.clip(req_freq); UHD_LOG_TRACE(unique_id(), "set_tx_frequency(f=" << freq << ", chan=" << chan << ")"); _desired_rf_freq[TX_DIRECTION]=freq; @@ -289,10 +289,10 @@ void magnesium_radio_ctrl_impl::_update_freq( } double magnesium_radio_ctrl_impl::set_rx_frequency( - const double freq, + const double req_freq, const size_t chan ) { - // FIXME bounds checking + clipping!!! + const double freq = MAGNESIUM_FREQ_RANGE.clip(req_freq); UHD_LOG_TRACE(unique_id(), "set_rx_frequency(f=" << freq << ", chan=" << chan << ")"); _desired_rf_freq[RX_DIRECTION]=freq; |