diff options
author | Ben Hilburn <ben.hilburn@ettus.com> | 2014-07-17 18:01:42 -0700 |
---|---|---|
committer | Ben Hilburn <ben.hilburn@ettus.com> | 2014-07-17 18:01:42 -0700 |
commit | 0efddecd45ff4756b046e5ebeb8626e54ffb19ff (patch) | |
tree | b89f7fea90b83f2ea015c5b7fe71f05e372ecaf9 /host | |
parent | 1af6628eb1edf29dffae771b8f3ada6952a50b69 (diff) | |
parent | 487e7fc2b41deb3867d24d8e4dacb10d2cafebb1 (diff) | |
download | uhd-0efddecd45ff4756b046e5ebeb8626e54ffb19ff.tar.gz uhd-0efddecd45ff4756b046e5ebeb8626e54ffb19ff.tar.bz2 uhd-0efddecd45ff4756b046e5ebeb8626e54ffb19ff.zip |
Merge branch 'origin/b200/bug516' into maint
Fixing B200 clock rate float compare.
Diffstat (limited to 'host')
-rw-r--r-- | host/lib/usrp/b200/b200_impl.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/host/lib/usrp/b200/b200_impl.cpp b/host/lib/usrp/b200/b200_impl.cpp index ac2407eba..bf5fdd251 100644 --- a/host/lib/usrp/b200/b200_impl.cpp +++ b/host/lib/usrp/b200/b200_impl.cpp @@ -681,10 +681,10 @@ void b200_impl::enforce_tick_rate_limits(size_t chan_count, double tick_rate, co else { const double max_tick_rate = ((chan_count <= 1) ? AD9361_1_CHAN_CLOCK_RATE_MAX : AD9361_2_CHAN_CLOCK_RATE_MAX); - if (tick_rate > max_tick_rate) + if (tick_rate - max_tick_rate >= 1.0) { throw uhd::value_error(boost::str( - boost::format("current master clock rate (%.2f MHz) exceeds maximum possible master clock rate (%.2f MHz) when using %d %s channels") + boost::format("current master clock rate (%.6f MHz) exceeds maximum possible master clock rate (%.6f MHz) when using %d %s channels") % (tick_rate/1e6) % (max_tick_rate/1e6) % chan_count @@ -696,12 +696,12 @@ void b200_impl::enforce_tick_rate_limits(size_t chan_count, double tick_rate, co double b200_impl::set_tick_rate(const double rate) { - UHD_MSG(status) << "Asking for clock rate " << rate/1e6 << " MHz\n"; + UHD_MSG(status) << (boost::format("Asking for clock rate %.6f MHz\n") % (rate/1e6)); check_tick_rate_with_current_streamers(rate); // Defined in b200_io_impl.cpp _tick_rate = _codec_ctrl->set_clock_rate(rate); - UHD_MSG(status) << "Actually got clock rate " << _tick_rate/1e6 << " MHz\n"; + UHD_MSG(status) << (boost::format("Actually got clock rate %.6f MHz\n") % (_tick_rate/1e6)); //reset after clock rate change this->reset_codec_dcm(); |