aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/dboard/twinrx/twinrx_io.hpp
diff options
context:
space:
mode:
authorKevin Gilbert <kevin.gilbert@ni.com>2016-08-04 12:02:10 -0700
committerMartin Braun <martin.braun@ettus.com>2016-08-05 08:38:26 -0700
commit63253ed7b2399b67d99878c7becc3926dfe17177 (patch)
tree326f92444200f1ead56231d1f5d2261730561c89 /host/lib/usrp/dboard/twinrx/twinrx_io.hpp
parentd21a7163ed2de9799064bf1ef980c3dac51c7b86 (diff)
downloaduhd-63253ed7b2399b67d99878c7becc3926dfe17177.tar.gz
uhd-63253ed7b2399b67d99878c7becc3926dfe17177.tar.bz2
uhd-63253ed7b2399b67d99878c7becc3926dfe17177.zip
Add sleep function to dboard_iface
Having this function allows a dboard_iface implementation to be aware of the timing of various calls such as SPI and register writes.
Diffstat (limited to 'host/lib/usrp/dboard/twinrx/twinrx_io.hpp')
-rw-r--r--host/lib/usrp/dboard/twinrx/twinrx_io.hpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/host/lib/usrp/dboard/twinrx/twinrx_io.hpp b/host/lib/usrp/dboard/twinrx/twinrx_io.hpp
index 8b504b549..5d099e361 100644
--- a/host/lib/usrp/dboard/twinrx/twinrx_io.hpp
+++ b/host/lib/usrp/dboard/twinrx/twinrx_io.hpp
@@ -108,10 +108,9 @@ public:
_db_iface->set_gpio_out(dboard_iface::UNIT_BOTH,
(cpld::get_reg(addr) << shift(CPLD_FULL_ADDR)) | (data << shift(CPLD_DATA)),
mask<boost::uint32_t>(CPLD_FULL_ADDR)|mask<boost::uint32_t>(CPLD_DATA));
- //Sleep for 166ns to ensure that we don't toggle the enables to quickly
- //nanosleep is not really accurate in userland and it is also not very
- //cross-platform. So just sleep for the minimum amount of time in us.
- boost::this_thread::sleep(boost::posix_time::microseconds(0));
+ //Sleep for 166ns to ensure that we don't toggle the enables too quickly
+ //The underlying sleep function rounds to microsecond precision.
+ _db_iface->sleep(boost::chrono::nanoseconds(166));
//Step 2: Write the reg offset and data, and assert the necessary enable
_db_iface->set_gpio_out(dboard_iface::UNIT_BOTH,
(static_cast<boost::uint32_t>(addr) << shift(CPLD_FULL_ADDR)) | (data << shift(CPLD_DATA)),