From 51bc00eed37b2bcc8c4d33b0093a7e3e573141a4 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Mon, 11 May 2015 17:12:30 -0700 Subject: b200: Added another rate check for auto tick rate mode --- host/lib/usrp/b200/b200_io_impl.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'host') diff --git a/host/lib/usrp/b200/b200_io_impl.cpp b/host/lib/usrp/b200/b200_io_impl.cpp index f4639807f..3171e25c3 100644 --- a/host/lib/usrp/b200/b200_io_impl.cpp +++ b/host/lib/usrp/b200/b200_io_impl.cpp @@ -82,6 +82,14 @@ void b200_impl::set_auto_tick_rate( num_chans = std::max(size_t(1), max_chan_count()); } const double max_tick_rate = ad9361_device_t::AD9361_MAX_CLOCK_RATE/num_chans; + if (rate != 0.0 and + (uhd::math::fp_compare::fp_compare_delta(rate, uhd::math::FREQ_COMPARISON_DELTA_HZ) > + uhd::math::fp_compare::fp_compare_delta(max_tick_rate, uhd::math::FREQ_COMPARISON_DELTA_HZ))) { + throw uhd::value_error(str( + boost::format("Requested sampling rate (%.2f Msps) exceeds maximum tick rate of %.2f MHz.") + % (rate / 1e6) % (max_tick_rate / 1e6) + )); + } // See also the doxygen documentation for these steps in b200_impl.hpp // Step 1: Obtain LCM and max rate from all relevant dsps -- cgit v1.2.3