diff options
author | Dimitri Stolnikov <horiz0n@gmx.net> | 2013-05-02 23:08:32 +0200 |
---|---|---|
committer | Dimitri Stolnikov <horiz0n@gmx.net> | 2013-05-02 23:08:32 +0200 |
commit | 2d9e29ee46b3b0d3f2552eca4c0a5b0f21d1e8d2 (patch) | |
tree | 97a9bbae06143ad9e1f9f768183ad2c369c83ef1 /lib/hackrf | |
parent | 59ceddbb749d0e43b0a85b677831a6896640f4e7 (diff) |
hackrf: replace non-portable usleep with boost sleep
Diffstat (limited to 'lib/hackrf')
-rw-r--r-- | lib/hackrf/hackrf_sink_c.cc | 4 | ||||
-rw-r--r-- | lib/hackrf/hackrf_source_c.cc | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/lib/hackrf/hackrf_sink_c.cc b/lib/hackrf/hackrf_sink_c.cc index c5d4572..59a4fc7 100644 --- a/lib/hackrf/hackrf_sink_c.cc +++ b/lib/hackrf/hackrf_sink_c.cc @@ -34,6 +34,7 @@ #include <boost/format.hpp> #include <boost/detail/endian.hpp> #include <boost/algorithm/string.hpp> +#include <boost/thread/thread.hpp> #include <gnuradio/gr_io_signature.h> @@ -313,7 +314,8 @@ bool hackrf_sink_c::stop() while ( hackrf_is_streaming( _dev ) ); /* FIXME: hackrf_stop_tx should wait until the device is ready for a start */ - usleep(100000); /* required if we want to immediately start() again */ + /* required if we want to immediately start() again */ + boost::this_thread::sleep( boost::posix_time::milliseconds(100) ); return ! (bool) hackrf_is_streaming( _dev ); } diff --git a/lib/hackrf/hackrf_source_c.cc b/lib/hackrf/hackrf_source_c.cc index 677bf36..a7689b2 100644 --- a/lib/hackrf/hackrf_source_c.cc +++ b/lib/hackrf/hackrf_source_c.cc @@ -34,6 +34,7 @@ #include <boost/format.hpp> #include <boost/detail/endian.hpp> #include <boost/algorithm/string.hpp> +#include <boost/thread/thread.hpp> #include <stdexcept> #include <iostream> @@ -276,7 +277,8 @@ bool hackrf_source_c::stop() while ( hackrf_is_streaming( _dev ) ); /* FIXME: hackrf_stop_rx should wait until the device is ready for a start */ - usleep(100000); /* required if we want to immediately start() again */ + /* required if we want to immediately start() again */ + boost::this_thread::sleep( boost::posix_time::milliseconds(100) ); return ! (bool) hackrf_is_streaming( _dev ); } |