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/dboard/db_dbsrx.cpp | 5 +++-- host/lib/usrp/dboard/db_tvrx2.cpp | 5 +++-- host/lib/usrp/dboard/db_ubx.cpp | 5 +++-- host/lib/usrp/dboard/db_xcvr2450.cpp | 9 +++++---- host/lib/usrp/dboard/twinrx/twinrx_ctrl.cpp | 5 +++-- 5 files changed, 17 insertions(+), 12 deletions(-) (limited to 'host/lib/usrp/dboard') diff --git a/host/lib/usrp/dboard/db_dbsrx.cpp b/host/lib/usrp/dboard/db_dbsrx.cpp index 8266b6d9e..587158470 100644 --- a/host/lib/usrp/dboard/db_dbsrx.cpp +++ b/host/lib/usrp/dboard/db_dbsrx.cpp @@ -22,10 +22,11 @@ #include #include #include -#include #include #include #include +#include +#include using namespace uhd; using namespace uhd::usrp; @@ -396,7 +397,7 @@ double dbsrx::set_lo_freq(double target_freq){ read_reg(0x0, 0x0); //allow for setup time before checking condition again - boost::this_thread::sleep(boost::posix_time::milliseconds(10)); + std::this_thread::sleep_for(std::chrono::milliseconds(10)); } UHD_LOGGER_TRACE("DBSRX") << boost::format( diff --git a/host/lib/usrp/dboard/db_tvrx2.cpp b/host/lib/usrp/dboard/db_tvrx2.cpp index 8bf2308d7..5f43c75e6 100644 --- a/host/lib/usrp/dboard/db_tvrx2.cpp +++ b/host/lib/usrp/dboard/db_tvrx2.cpp @@ -53,11 +53,12 @@ #include #include #include -#include #include #include #include #include +#include +#include using namespace uhd; using namespace uhd::usrp; @@ -1695,7 +1696,7 @@ void tvrx2::wait_irq(void){ while (not irq and timeout > 0) { //irq = (this->get_iface()->read_gpio(dboard_iface::UNIT_RX) & tvrx2_sd_name_to_irq_io[get_subdev_name()]); irq = get_irq(); - boost::this_thread::sleep(boost::posix_time::milliseconds(10)); + std::this_thread::sleep_for(std::chrono::milliseconds(10)); timeout -= 1; } diff --git a/host/lib/usrp/dboard/db_ubx.cpp b/host/lib/usrp/dboard/db_ubx.cpp index 0e85cf188..6c6862fb7 100644 --- a/host/lib/usrp/dboard/db_ubx.cpp +++ b/host/lib/usrp/dboard/db_ubx.cpp @@ -23,10 +23,11 @@ #include #include #include -#include #include #include #include +#include +#include using namespace uhd; using namespace uhd::usrp; @@ -384,7 +385,7 @@ public: _iface->set_pin_ctrl(dboard_iface::UNIT_RX, _rx_gpio_reg.atr_mask); // bring CPLD out of reset - boost::this_thread::sleep(boost::posix_time::milliseconds(20)); // hold CPLD reset for minimum of 20 ms + std::this_thread::sleep_for(std::chrono::milliseconds(20)); // hold CPLD reset for minimum of 20 ms set_gpio_field(CPLD_RST_N, 1); write_gpio(); diff --git a/host/lib/usrp/dboard/db_xcvr2450.cpp b/host/lib/usrp/dboard/db_xcvr2450.cpp index 73e778b1b..9e1c9f2b0 100644 --- a/host/lib/usrp/dboard/db_xcvr2450.cpp +++ b/host/lib/usrp/dboard/db_xcvr2450.cpp @@ -50,9 +50,10 @@ #include #include #include -#include #include #include +#include +#include using namespace uhd; using namespace uhd::usrp; @@ -307,11 +308,11 @@ void xcvr2450::spi_reset(void){ //spi reset mode: global enable = off, tx and rx enable = on this->get_iface()->set_atr_reg(dboard_iface::UNIT_TX, gpio_atr::ATR_REG_IDLE, TX_ENB_TXIO); this->get_iface()->set_atr_reg(dboard_iface::UNIT_RX, gpio_atr::ATR_REG_IDLE, RX_ENB_RXIO | POWER_DOWN_RXIO); - boost::this_thread::sleep(boost::posix_time::milliseconds(10)); + std::this_thread::sleep_for(std::chrono::milliseconds(10)); //take it back out of spi reset mode and wait a bit this->get_iface()->set_atr_reg(dboard_iface::UNIT_RX, gpio_atr::ATR_REG_IDLE, RX_DIS_RXIO | POWER_UP_RXIO); - boost::this_thread::sleep(boost::posix_time::milliseconds(10)); + std::this_thread::sleep_for(std::chrono::milliseconds(10)); } /*********************************************************************** @@ -348,7 +349,7 @@ double xcvr2450::set_lo_freq(double target_freq){ double actual = 0.0; for (double offset = 0.0; offset <= 3e6; offset+=1e6){ actual = this->set_lo_freq_core(target_freq + offset); - boost::this_thread::sleep(boost::posix_time::milliseconds(50)); + std::this_thread::sleep_for(std::chrono::milliseconds(50)); if (this->get_locked().to_bool()) break; } return actual; diff --git a/host/lib/usrp/dboard/twinrx/twinrx_ctrl.cpp b/host/lib/usrp/dboard/twinrx/twinrx_ctrl.cpp index 3e8473087..d8233e1f7 100644 --- a/host/lib/usrp/dboard/twinrx/twinrx_ctrl.cpp +++ b/host/lib/usrp/dboard/twinrx/twinrx_ctrl.cpp @@ -10,7 +10,8 @@ #include #include #include -#include +#include +#include using namespace uhd; using namespace usrp; @@ -40,7 +41,7 @@ public: _gpio_iface->set_field(twinrx_gpio::FIELD_SWPS_EN, 1); size_t timeout_ms = 100; while (_gpio_iface->get_field(twinrx_gpio::FIELD_SWPS_PWR_GOOD) == 0) { - boost::this_thread::sleep(boost::posix_time::microsec(1000)); + std::this_thread::sleep_for(std::chrono::microseconds(1000)); if (--timeout_ms == 0) { throw uhd::runtime_error("power supply failure"); } -- cgit v1.2.3