aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/b200/b200_impl.cpp
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2018-05-09 16:56:35 -0700
committerMartin Braun <martin.braun@ettus.com>2018-05-14 17:24:19 -0700
commit38a7fa64f464084fa11708bdbe00cfabc311df29 (patch)
treed8fa3985a87d237715496ae1f800c76dbf189f6f /host/lib/usrp/b200/b200_impl.cpp
parent5df5177d49b999ccab30199f9becfa84c1bef52e (diff)
downloaduhd-38a7fa64f464084fa11708bdbe00cfabc311df29.tar.gz
uhd-38a7fa64f464084fa11708bdbe00cfabc311df29.tar.bz2
uhd-38a7fa64f464084fa11708bdbe00cfabc311df29.zip
lib: Remove some unnecessary use of boost::posix_time
Replace by std::chrono.
Diffstat (limited to 'host/lib/usrp/b200/b200_impl.cpp')
-rw-r--r--host/lib/usrp/b200/b200_impl.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/host/lib/usrp/b200/b200_impl.cpp b/host/lib/usrp/b200/b200_impl.cpp
index 56b05a9ae..dac54bb05 100644
--- a/host/lib/usrp/b200/b200_impl.cpp
+++ b/host/lib/usrp/b200/b200_impl.cpp
@@ -26,6 +26,7 @@
#include <cstdio>
#include <ctime>
#include <cmath>
+#include <chrono>
#include "../../transport/libusb1_base.hpp"
@@ -34,7 +35,9 @@ using namespace uhd::usrp;
using namespace uhd::usrp::gpio_atr;
using namespace uhd::transport;
-static const boost::posix_time::milliseconds REENUMERATION_TIMEOUT_MS(3000);
+namespace {
+ constexpr int64_t REENUMERATION_TIMEOUT_MS = 3000;
+}
// B200 + B210:
class b200_ad9361_client_t : public ad9361_params {
@@ -197,13 +200,14 @@ static device_addrs_t b200_find(const device_addr_t &hint)
found++;
}
- const boost::system_time timeout_time = boost::get_system_time() + REENUMERATION_TIMEOUT_MS;
-
+ const auto timeout_time =
+ std::chrono::steady_clock::now()
+ + std::chrono::milliseconds(REENUMERATION_TIMEOUT_MS);
//search for the device until found or timeout
- while (boost::get_system_time() < timeout_time and b200_addrs.empty() and found != 0)
- {
- for(usb_device_handle::sptr handle: get_b200_device_handles(hint))
- {
+ while (std::chrono::steady_clock::now() < timeout_time
+ and b200_addrs.empty()
+ and found != 0) {
+ for(usb_device_handle::sptr handle: get_b200_device_handles(hint)) {
usb_control::sptr control;
try{control = usb_control::make(handle, 0);}
catch(const uhd::exception &){continue;} //ignore claimed