From 0303f1ed558b21e40f80c388b096432b4bf6e883 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Thu, 26 Apr 2018 09:30:48 -0700 Subject: lib: Purge all references to boost::this_thread::sleep() Replace with std::this_thread::sleep_for(). --- host/lib/usrp/e300/e300_fifo_config.cpp | 4 +++- host/lib/usrp/e300/e300_i2c.cpp | 9 +++++---- host/lib/usrp/e300/e300_impl.cpp | 9 +++++---- host/lib/usrp/e300/e300_network.cpp | 5 +++-- 4 files changed, 16 insertions(+), 11 deletions(-) (limited to 'host/lib/usrp/e300') diff --git a/host/lib/usrp/e300/e300_fifo_config.cpp b/host/lib/usrp/e300/e300_fifo_config.cpp index 044ce01ee..2c0027ae0 100644 --- a/host/lib/usrp/e300/e300_fifo_config.cpp +++ b/host/lib/usrp/e300/e300_fifo_config.cpp @@ -11,6 +11,8 @@ #include #include #include +#include +#include // constants coded into the fpga parameters static const size_t ZF_CONFIG_BASE = 0x40000000; @@ -256,7 +258,7 @@ public: break; } _waiter->wait(timeout); - //boost::this_thread::sleep(boost::posix_time::milliseconds(1)); + //std::this_thread::sleep_for(std::chrono::milliseconds(1)); } return typename T::sptr(); diff --git a/host/lib/usrp/e300/e300_i2c.cpp b/host/lib/usrp/e300/e300_i2c.cpp index c3db4f67a..24fd429b5 100644 --- a/host/lib/usrp/e300/e300_i2c.cpp +++ b/host/lib/usrp/e300/e300_i2c.cpp @@ -5,13 +5,14 @@ // SPDX-License-Identifier: GPL-3.0-or-later // +#include "e300_i2c.hpp" #include #include #include - -#include "e300_i2c.hpp" #include +#include +#include namespace uhd { namespace usrp { namespace e300 { @@ -281,7 +282,7 @@ public: throw std::runtime_error("ioctl failed"); } // this is ugly - boost::this_thread::sleep(boost::posix_time::milliseconds(5)); + std::this_thread::sleep_for(std::chrono::milliseconds(5)); } uint8_t get_i2c_reg8( @@ -339,7 +340,7 @@ public: throw std::runtime_error("ioctl failed"); } // this is ugly - boost::this_thread::sleep(boost::posix_time::milliseconds(5)); + std::this_thread::sleep_for(std::chrono::milliseconds(5)); } diff --git a/host/lib/usrp/e300/e300_impl.cpp b/host/lib/usrp/e300/e300_impl.cpp index 324b25407..9aa872ff3 100644 --- a/host/lib/usrp/e300/e300_impl.cpp +++ b/host/lib/usrp/e300/e300_impl.cpp @@ -32,9 +32,10 @@ #include #include #include -#include //sleep #include #include +#include +#include using namespace uhd; using namespace uhd::usrp; @@ -395,7 +396,7 @@ e300_impl::e300_impl(const uhd::device_addr_t &device_addr) ad9361_params::sptr client_settings = boost::make_shared(); _codec_ctrl = ad9361_ctrl::make_spi(client_settings, spi::make(E300_SPIDEV_DEVICE), 1); // This is horrible ... why do I have to sleep here? - boost::this_thread::sleep(boost::posix_time::milliseconds(100)); + std::this_thread::sleep_for(std::chrono::milliseconds(100)); _eeprom_manager = boost::make_shared(i2c::make_i2cdev(E300_I2CDEV_DEVICE)); _sensor_manager = e300_sensor_manager::make_local(_global_regs); } @@ -415,7 +416,7 @@ e300_impl::e300_impl(const uhd::device_addr_t &device_addr) if (_gps) { for (size_t i = 0; i < _GPS_TIMEOUT; i++) { - boost::this_thread::sleep(boost::posix_time::seconds(1)); + std::this_thread::sleep_for(std::chrono::seconds(1)); if (!_gps->gps_detected()) std::cout << "." << std::flush; else { @@ -1141,7 +1142,7 @@ void e300_impl::_reset_codec_mmcm(void) { _misc.codec_arst = 1; _update_gpio_state(); - boost::this_thread::sleep(boost::posix_time::milliseconds(10)); + std::this_thread::sleep_for(std::chrono::milliseconds(10)); _misc.codec_arst = 0; _update_gpio_state(); } diff --git a/host/lib/usrp/e300/e300_network.cpp b/host/lib/usrp/e300/e300_network.cpp index d7473d2ee..d9a104dda 100644 --- a/host/lib/usrp/e300/e300_network.cpp +++ b/host/lib/usrp/e300/e300_network.cpp @@ -26,11 +26,12 @@ #include #include -#include #include #include #include +#include +#include using namespace uhd; using namespace uhd::transport; @@ -630,7 +631,7 @@ network_server_impl::network_server_impl(const uhd::device_addr_t &device_addr) ad9361_params::sptr client_settings = boost::make_shared(); _codec_ctrl = ad9361_ctrl::make_spi(client_settings, spi::make(E300_SPIDEV_DEVICE), 1); // This is horrible ... why do I have to sleep here? - boost::this_thread::sleep(boost::posix_time::milliseconds(100)); + std::this_thread::sleep_for(std::chrono::milliseconds(100)); _sensor_manager = e300_sensor_manager::make_local(_global_regs); } -- cgit v1.2.3