From 9df9bea6c1812fdc03ef8ace29859f0c64d382d2 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Thu, 26 Apr 2018 14:43:12 -0700 Subject: lib: Purge some use of boost::system_time These are all timeout loops, which now use std::chrono::steady_clock::now() to check for timeout events. --- host/lib/usrp/x300/x300_fw_uart.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'host/lib/usrp/x300/x300_fw_uart.cpp') diff --git a/host/lib/usrp/x300/x300_fw_uart.cpp b/host/lib/usrp/x300/x300_fw_uart.cpp index 3711cb48b..b6c2081ad 100644 --- a/host/lib/usrp/x300/x300_fw_uart.cpp +++ b/host/lib/usrp/x300/x300_fw_uart.cpp @@ -12,7 +12,7 @@ #include #include #include -#include +#include using namespace uhd; @@ -126,7 +126,10 @@ struct x300_uart_iface : uart_iface std::string read_uart(double timeout) { boost::mutex::scoped_lock(_read_mutex); - const boost::system_time exit_time = boost::get_system_time() + boost::posix_time::microseconds(long(timeout*1e6)); + const auto exit_time = + std::chrono::steady_clock::now() + + std::chrono::microseconds(int64_t(timeout*1e6)); + std::string buff; while (true) @@ -149,8 +152,9 @@ struct x300_uart_iface : uart_iface } // no more characters - check time - if (boost::get_system_time() > exit_time) + if (std::chrono::steady_clock::now() > exit_time) { break; + } } return buff; -- cgit v1.2.3