aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/b100
diff options
context:
space:
mode:
Diffstat (limited to 'host/lib/usrp/b100')
-rw-r--r--host/lib/usrp/b100/clock_ctrl.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/host/lib/usrp/b100/clock_ctrl.cpp b/host/lib/usrp/b100/clock_ctrl.cpp
index e30ca120f..676ebd981 100644
--- a/host/lib/usrp/b100/clock_ctrl.cpp
+++ b/host/lib/usrp/b100/clock_ctrl.cpp
@@ -11,10 +11,11 @@
#include <uhd/exception.hpp>
#include <uhd/utils/assert_has.hpp>
#include <uhd/utils/log.hpp>
+#include <uhd/utils/math.hpp>
#include <uhd/utils/safe_call.hpp>
+#include <uhdlib/utils/narrow.hpp>
#include <stdint.h>
#include <boost/format.hpp>
-#include <boost/math/common_factor_rt.hpp> //gcd
#include <algorithm>
#include <chrono>
#include <thread>
@@ -122,7 +123,8 @@ static clock_settings_type get_clock_settings(double rate)
const uint64_t out_rate = uint64_t(rate);
const uint64_t ref_rate = uint64_t(cs.get_ref_rate());
- const size_t gcd = size_t(boost::math::gcd(ref_rate, out_rate));
+ const size_t gcd =
+ uhd::narrow_cast<size_t>((uhd::math::gcd<size_t>(ref_rate, out_rate)));
for (size_t i = 1; i <= 100; i++) {
const size_t X = size_t(i * ref_rate / gcd);
@@ -312,7 +314,7 @@ public:
const double ref_rate = REFERENCE_INPUT_RATE * 2;
// bypass prescaler such that N = B
- long gcd = boost::math::gcd(long(ref_rate), long(rate));
+ long gcd = uhd::math::gcd(long(ref_rate), long(rate));
_ad9522_regs.set_r_counter(int(ref_rate / gcd));
_ad9522_regs.a_counter = 0;
_ad9522_regs.set_b_counter(int(rate / gcd));