diff options
author | Martin Braun <martin.braun@ettus.com> | 2015-05-11 17:12:30 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2015-05-11 17:12:30 -0700 |
commit | 51bc00eed37b2bcc8c4d33b0093a7e3e573141a4 (patch) | |
tree | 3dc5031d9659d4da9e50f11b1eac0e5278156617 /host/lib/usrp | |
parent | 27b8dbc1aaf1b840e235c247f06508e8c64cba8d (diff) | |
download | uhd-51bc00eed37b2bcc8c4d33b0093a7e3e573141a4.tar.gz uhd-51bc00eed37b2bcc8c4d33b0093a7e3e573141a4.tar.bz2 uhd-51bc00eed37b2bcc8c4d33b0093a7e3e573141a4.zip |
b200: Added another rate check for auto tick rate mode
Diffstat (limited to 'host/lib/usrp')
-rw-r--r-- | host/lib/usrp/b200/b200_io_impl.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
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<double>(rate, uhd::math::FREQ_COMPARISON_DELTA_HZ) > + uhd::math::fp_compare::fp_compare_delta<double>(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 |