aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2016-12-09 11:26:45 -0800
committerMartin Braun <martin.braun@ettus.com>2016-12-09 11:26:45 -0800
commitd29960ec1466dbe009dad649672c33ee44467e27 (patch)
tree1babe0ae519d4ecba50031f079661936e925307e /host/lib
parent785c9a14d60b302a6f1ea1de8eae46d9093b7d21 (diff)
parenteb2ba5ea16445c1cef1fb8dbef72d78dcf8c68a3 (diff)
downloaduhd-d29960ec1466dbe009dad649672c33ee44467e27.tar.gz
uhd-d29960ec1466dbe009dad649672c33ee44467e27.tar.bz2
uhd-d29960ec1466dbe009dad649672c33ee44467e27.zip
Merge branch 'maint'
Diffstat (limited to 'host/lib')
-rw-r--r--host/lib/usrp/x300/x300_radio_ctrl_impl.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/host/lib/usrp/x300/x300_radio_ctrl_impl.cpp b/host/lib/usrp/x300/x300_radio_ctrl_impl.cpp
index 4bb9c9fb5..bb17eb2ec 100644
--- a/host/lib/usrp/x300/x300_radio_ctrl_impl.cpp
+++ b/host/lib/usrp/x300/x300_radio_ctrl_impl.cpp
@@ -26,6 +26,7 @@
#include <uhd/usrp/dboard_iface.hpp>
#include <uhd/rfnoc/node_ctrl_base.hpp>
#include <uhd/transport/chdr.hpp>
+#include <uhd/utils/math.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/make_shared.hpp>
#include <boost/date_time/posix_time/posix_time_io.hpp>
@@ -167,10 +168,14 @@ x300_radio_ctrl_impl::~x300_radio_ctrl_impl()
/****************************************************************************
* API calls
***************************************************************************/
-double x300_radio_ctrl_impl::set_rate(double /* rate */)
+double x300_radio_ctrl_impl::set_rate(double rate)
{
+ const double actual_rate = get_rate();
+ if (not uhd::math::frequencies_are_equal(rate, actual_rate)) {
+ UHD_MSG(warning) << "[X300 Radio] Requesting invalid sampling rate from device: " << rate/1e6 << " MHz. Actual rate is: " << actual_rate/1e6 << " MHz." << std::endl;
+ }
// On X3x0, tick rate can't actually be changed at runtime
- return get_rate();
+ return actual_rate;
}
void x300_radio_ctrl_impl::set_fe_cmd_time(const time_spec_t &time, const size_t chan)