diff options
author | Josh Blum <josh@joshknows.com> | 2011-06-29 13:57:06 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2011-06-29 13:57:06 -0700 |
commit | bc8aaf3952f1c192030d1c9a0b6ddcbe14d9c062 (patch) | |
tree | 3ab8a27c2ccd0240925cde1c5a23f8b99af0c504 /host/lib | |
parent | d38757f4656028800e393c91bf3fec1986eb0200 (diff) | |
download | uhd-bc8aaf3952f1c192030d1c9a0b6ddcbe14d9c062.tar.gz uhd-bc8aaf3952f1c192030d1c9a0b6ddcbe14d9c062.tar.bz2 uhd-bc8aaf3952f1c192030d1c9a0b6ddcbe14d9c062.zip |
uhd: misc tweaks and also msvc compile
Diffstat (limited to 'host/lib')
-rw-r--r-- | host/lib/usrp/cores/time64_core_200.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/host/lib/usrp/cores/time64_core_200.cpp b/host/lib/usrp/cores/time64_core_200.cpp index 843d4bdfb..772a2a2bb 100644 --- a/host/lib/usrp/cores/time64_core_200.cpp +++ b/host/lib/usrp/cores/time64_core_200.cpp @@ -18,6 +18,7 @@ #include "time64_core_200.hpp" #include <uhd/exception.hpp> #include <uhd/utils/assert_has.hpp> +#include <boost/math/special_functions/round.hpp> #define REG_TIME64_SECS _base + 0 #define REG_TIME64_TICKS _base + 4 @@ -58,11 +59,11 @@ public: void set_tick_rate(const double rate){ _tick_rate = rate; - _iface->poke32(REG_TIME64_TPS, rate); + _iface->poke32(REG_TIME64_TPS, boost::math::iround(rate)); } uhd::time_spec_t get_time_now(void){ - for (size_t i = 0; i < 3; i++){ //special algorithm because we cant rest 64 bits synchronously + for (size_t i = 0; i < 3; i++){ //special algorithm because we cant read 64 bits synchronously const boost::uint32_t secs = _iface->peek32(_readback_bases.rb_secs_imm); const boost::uint32_t ticks = _iface->peek32(_readback_bases.rb_ticks_imm); if (secs != _iface->peek32(_readback_bases.rb_secs_imm)) continue; @@ -72,7 +73,7 @@ public: } uhd::time_spec_t get_time_last_pps(void){ - for (size_t i = 0; i < 3; i++){ //special algorithm because we cant rest 64 bits synchronously + for (size_t i = 0; i < 3; i++){ //special algorithm because we cant read 64 bits synchronously const boost::uint32_t secs = _iface->peek32(_readback_bases.rb_secs_pps); const boost::uint32_t ticks = _iface->peek32(_readback_bases.rb_ticks_pps); if (secs != _iface->peek32(_readback_bases.rb_secs_pps)) continue; |