aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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)