diff options
author | Martin Braun <martin.braun@ettus.com> | 2018-05-09 16:56:35 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2018-05-14 17:24:19 -0700 |
commit | 38a7fa64f464084fa11708bdbe00cfabc311df29 (patch) | |
tree | d8fa3985a87d237715496ae1f800c76dbf189f6f /host/lib/usrp/common | |
parent | 5df5177d49b999ccab30199f9becfa84c1bef52e (diff) | |
download | uhd-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/common')
-rw-r--r-- | host/lib/usrp/common/ad9361_driver/ad9361_device.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/host/lib/usrp/common/ad9361_driver/ad9361_device.cpp b/host/lib/usrp/common/ad9361_driver/ad9361_device.cpp index 54f15d1a8..56df8bd12 100644 --- a/host/lib/usrp/common/ad9361_driver/ad9361_device.cpp +++ b/host/lib/usrp/common/ad9361_driver/ad9361_device.cpp @@ -2188,15 +2188,15 @@ double ad9361_device_t::_get_temperature(const double cal_offset, const double t _io_iface->poke8(0x00B, 0); //set offset to 0 _io_iface->poke8(0x00C, 0x01); //start reading, clears bit 0x00C[1] - boost::posix_time::ptime start_time = boost::posix_time::microsec_clock::local_time(); - boost::posix_time::time_duration elapsed; + auto end_time = + std::chrono::steady_clock::now() + + std::chrono::milliseconds(int64_t(timeout * 1000)); //wait for valid data (toggle of bit 1 in 0x00C) while(((_io_iface->peek8(0x00C) >> 1) & 0x01) == 0) { std::this_thread::sleep_for(std::chrono::microseconds(100)); - elapsed = boost::posix_time::microsec_clock::local_time() - start_time; - if(elapsed.total_milliseconds() > (timeout*1000)) - { - throw uhd::runtime_error("[ad9361_device_t] timeout while reading temperature"); + if (std::chrono::steady_clock::now() > end_time) { + throw uhd::runtime_error( + "[ad9361_device_t] timeout while reading temperature"); } } _io_iface->poke8(0x00C, 0x00); //clear read flag |