aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/cores
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2018-04-26 09:30:48 -0700
committerMartin Braun <martin.braun@ettus.com>2018-04-30 17:10:26 -0700
commit0303f1ed558b21e40f80c388b096432b4bf6e883 (patch)
tree05afcc4d2401bb86f9e38e3b04ec5b07e9268302 /host/lib/usrp/cores
parentfc67052345373c6d5c1b62064a9f9ef6f888e3ff (diff)
downloaduhd-0303f1ed558b21e40f80c388b096432b4bf6e883.tar.gz
uhd-0303f1ed558b21e40f80c388b096432b4bf6e883.tar.bz2
uhd-0303f1ed558b21e40f80c388b096432b4bf6e883.zip
lib: Purge all references to boost::this_thread::sleep()
Replace with std::this_thread::sleep_for().
Diffstat (limited to 'host/lib/usrp/cores')
-rw-r--r--host/lib/usrp/cores/dma_fifo_core_3000.cpp9
-rw-r--r--host/lib/usrp/cores/i2c_core_100_wb32.cpp5
-rw-r--r--host/lib/usrp/cores/i2c_core_200.cpp5
-rw-r--r--host/lib/usrp/cores/rx_dsp_core_200.cpp5
-rw-r--r--host/lib/usrp/cores/time_core_3000.cpp5
-rw-r--r--host/lib/usrp/cores/tx_dsp_core_200.cpp5
6 files changed, 20 insertions, 14 deletions
diff --git a/host/lib/usrp/cores/dma_fifo_core_3000.cpp b/host/lib/usrp/cores/dma_fifo_core_3000.cpp
index 618f81f64..445706574 100644
--- a/host/lib/usrp/cores/dma_fifo_core_3000.cpp
+++ b/host/lib/usrp/cores/dma_fifo_core_3000.cpp
@@ -10,7 +10,8 @@
#include <uhd/utils/log.hpp>
#include <uhdlib/usrp/cores/dma_fifo_core_3000.hpp>
#include <boost/format.hpp>
-#include <boost/thread/thread.hpp> //sleep
+#include <chrono>
+#include <thread>
using namespace uhd;
@@ -315,7 +316,7 @@ public:
_bist_ctrl_reg.write(bist_ctrl_reg_t::GO, 1);
if (!finite) {
- boost::this_thread::sleep(boost::posix_time::milliseconds(timeout_ms));
+ std::this_thread::sleep_for(std::chrono::milliseconds(timeout_ms));
}
_wait_for_bist_done(timeout_ms, !finite);
@@ -345,7 +346,7 @@ private:
boost::posix_time::time_duration elapsed;
while (_fifo_readback.is_fifo_busy()) {
- boost::this_thread::sleep(boost::posix_time::microsec(1000));
+ std::this_thread::sleep_for(std::chrono::microseconds(1000));
elapsed = boost::posix_time::microsec_clock::local_time() - start_time;
if (elapsed.total_milliseconds() > 100) break;
}
@@ -361,7 +362,7 @@ private:
_bist_ctrl_reg.write(bist_ctrl_reg_t::GO, 0);
force_stop = false;
}
- boost::this_thread::sleep(boost::posix_time::microsec(1000));
+ std::this_thread::sleep_for(std::chrono::microseconds(1000));
elapsed = boost::posix_time::microsec_clock::local_time() - start_time;
if (elapsed.total_milliseconds() > timeout_ms) break;
}
diff --git a/host/lib/usrp/cores/i2c_core_100_wb32.cpp b/host/lib/usrp/cores/i2c_core_100_wb32.cpp
index c6a0e8d84..ec47aa8f0 100644
--- a/host/lib/usrp/cores/i2c_core_100_wb32.cpp
+++ b/host/lib/usrp/cores/i2c_core_100_wb32.cpp
@@ -8,7 +8,8 @@
#include <uhd/exception.hpp>
#include <uhd/utils/log.hpp>
#include <uhdlib/usrp/cores/i2c_core_100_wb32.hpp>
-#include <boost/thread/thread.hpp> //sleep
+#include <chrono>
+#include <thread>
#define REG_I2C_PRESCALER_LO _base + 0
#define REG_I2C_PRESCALER_HI _base + 4
@@ -126,7 +127,7 @@ private:
for (size_t i = 0; i < 10; i++)
{
if ((_iface->peek32(REG_I2C_CMD_STATUS) & I2C_ST_TIP) == 0) return;
- boost::this_thread::sleep(boost::posix_time::milliseconds(1));
+ std::this_thread::sleep_for(std::chrono::milliseconds(1));
}
UHD_LOGGER_ERROR("CORES") << "i2c_core_100_wb32: i2c_wait timeout" ;
}
diff --git a/host/lib/usrp/cores/i2c_core_200.cpp b/host/lib/usrp/cores/i2c_core_200.cpp
index c0a6cb949..4278bf611 100644
--- a/host/lib/usrp/cores/i2c_core_200.cpp
+++ b/host/lib/usrp/cores/i2c_core_200.cpp
@@ -8,8 +8,9 @@
#include <uhd/exception.hpp>
#include <uhd/utils/log.hpp>
#include <uhdlib/usrp/cores/i2c_core_200.hpp>
-#include <boost/thread/thread.hpp> //sleep
#include <boost/thread/mutex.hpp>
+#include <chrono>
+#include <thread>
#define REG_I2C_WR_PRESCALER_LO (1 << 3) | 0
#define REG_I2C_WR_PRESCALER_HI (1 << 3) | 1
@@ -118,7 +119,7 @@ private:
void i2c_wait(void) {
for (size_t i = 0; i < 100; i++){
if ((this->peek(REG_I2C_RD_ST) & I2C_ST_TIP) == 0) return;
- boost::this_thread::sleep(boost::posix_time::milliseconds(1));
+ std::this_thread::sleep_for(std::chrono::milliseconds(1));
}
UHD_LOGGER_ERROR("CORES") << "i2c_core_200: i2c_wait timeout" ;
}
diff --git a/host/lib/usrp/cores/rx_dsp_core_200.cpp b/host/lib/usrp/cores/rx_dsp_core_200.cpp
index 730985fdd..a87b92a50 100644
--- a/host/lib/usrp/cores/rx_dsp_core_200.cpp
+++ b/host/lib/usrp/cores/rx_dsp_core_200.cpp
@@ -13,11 +13,12 @@
#include <uhdlib/usrp/cores/rx_dsp_core_200.hpp>
#include <uhdlib/usrp/cores/dsp_core_utils.hpp>
#include <boost/assign/list_of.hpp>
-#include <boost/thread/thread.hpp> //thread sleep
#include <boost/math/special_functions/round.hpp>
#include <boost/numeric/conversion/bounds.hpp>
#include <algorithm>
#include <cmath>
+#include <chrono>
+#include <thread>
#define REG_DSP_RX_FREQ _dsp_base + 0
#define REG_DSP_RX_SCALE_IQ _dsp_base + 4
@@ -69,7 +70,7 @@ public:
stream_cmd_t stream_cmd(stream_cmd_t::STREAM_MODE_NUM_SAMPS_AND_DONE);
stream_cmd.num_samps = 1;
issue_stream_command(stream_cmd);
- boost::this_thread::sleep(boost::posix_time::milliseconds(10)); //lets lingering pkt propagate
+ std::this_thread::sleep_for(std::chrono::milliseconds(10)); //lets lingering pkt propagate
}
this->clear();
diff --git a/host/lib/usrp/cores/time_core_3000.cpp b/host/lib/usrp/cores/time_core_3000.cpp
index edec2880b..3fb6c3d57 100644
--- a/host/lib/usrp/cores/time_core_3000.cpp
+++ b/host/lib/usrp/cores/time_core_3000.cpp
@@ -8,7 +8,8 @@
#include <uhd/utils/safe_call.hpp>
#include <uhd/utils/log.hpp>
#include <uhdlib/usrp/cores/time_core_3000.hpp>
-#include <boost/thread/thread.hpp>
+#include <chrono>
+#include <thread>
#define REG_TIME_HI _base + 0
#define REG_TIME_LO _base + 4
@@ -55,7 +56,7 @@ struct time_core_3000_impl : time_core_3000
const size_t sleep_millis = 100;
UHD_LOGGER_DEBUG("CORES") << "Performing timer loopback test... ";
const time_spec_t time0 = this->get_time_now();
- boost::this_thread::sleep(boost::posix_time::milliseconds(sleep_millis));
+ std::this_thread::sleep_for(std::chrono::milliseconds(sleep_millis));
const time_spec_t time1 = this->get_time_now();
const double approx_secs = (time1 - time0).get_real_secs();
const bool test_fail = (approx_secs > 0.15) or (approx_secs < 0.05);
diff --git a/host/lib/usrp/cores/tx_dsp_core_200.cpp b/host/lib/usrp/cores/tx_dsp_core_200.cpp
index efd64f7e5..6418d7049 100644
--- a/host/lib/usrp/cores/tx_dsp_core_200.cpp
+++ b/host/lib/usrp/cores/tx_dsp_core_200.cpp
@@ -13,9 +13,10 @@
#include <uhd/utils/log.hpp>
#include <boost/assign/list_of.hpp>
#include <boost/math/special_functions/round.hpp>
-#include <boost/thread/thread.hpp> //sleep
#include <algorithm>
#include <cmath>
+#include <chrono>
+#include <thread>
#define REG_DSP_TX_FREQ _dsp_base + 0
#define REG_DSP_TX_SCALE_IQ _dsp_base + 4
@@ -68,7 +69,7 @@ public:
void clear(void){
_iface->poke32(REG_TX_CTRL_CLEAR, 1); //reset and flush technique
- boost::this_thread::sleep(boost::posix_time::milliseconds(10));
+ std::this_thread::sleep_for(std::chrono::milliseconds(10));
_iface->poke32(REG_TX_CTRL_CLEAR, 0);
_iface->poke32(REG_TX_CTRL_REPORT_SID, _sid);
}