From 9c56eb9261b315ab4a29e8ab0a94142c85f21413 Mon Sep 17 00:00:00 2001 From: Vidush Date: Wed, 20 Jun 2018 13:33:21 -0700 Subject: B200: Enforce min_tick_rate --- host/lib/usrp/b200/b200_impl.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/host/lib/usrp/b200/b200_impl.cpp b/host/lib/usrp/b200/b200_impl.cpp index dac54bb05..a91bccf94 100644 --- a/host/lib/usrp/b200/b200_impl.cpp +++ b/host/lib/usrp/b200/b200_impl.cpp @@ -936,6 +936,17 @@ void b200_impl::enforce_tick_rate_limits(size_t chan_count, double tick_rate, co % (direction.empty() ? "data" : direction) )); } + const double min_tick_rate = ad9361_device_t::AD9361_MIN_CLOCK_RATE / ((chan_count <= 1) ? 1 : 2); + if (min_tick_rate - tick_rate >= 1.0) + { + throw uhd::value_error(boost::str( + boost::format("current master clock rate (%.6f MHz) is less than minimum possible master clock rate (%.6f MHz) when using %d %s channels") + % (tick_rate/1e6) + % (min_tick_rate/1e6) + % chan_count + % (direction.empty() ? "data" : direction) + )); + } } } -- cgit v1.2.3