diff options
Diffstat (limited to 'host')
-rw-r--r-- | host/examples/benchmark_rx_rate.cpp | 3 | ||||
-rw-r--r-- | host/lib/usrp/usrp1/soft_time_ctrl.cpp | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/host/examples/benchmark_rx_rate.cpp b/host/examples/benchmark_rx_rate.cpp index c49d8bff0..c993af970 100644 --- a/host/examples/benchmark_rx_rate.cpp +++ b/host/examples/benchmark_rx_rate.cpp @@ -89,7 +89,8 @@ static inline void test_device( got_first_packet = true; } - total_lost_samples += boost::math::iround(rx_rate_sps*(md.time_spec - next_expected_time_spec).get_real_secs()); + double approx_lost_samps = rx_rate_sps*(md.time_spec - next_expected_time_spec).get_real_secs(); + total_lost_samples += std::max(0, boost::math::iround(approx_lost_samps)); next_expected_time_spec = md.time_spec + uhd::time_spec_t(0, num_rx_samps, rx_rate_sps); } while((next_expected_time_spec - initial_time_spec) < uhd::time_spec_t(duration_secs)); diff --git a/host/lib/usrp/usrp1/soft_time_ctrl.cpp b/host/lib/usrp/usrp1/soft_time_ctrl.cpp index 856faf89d..c91ecc7ed 100644 --- a/host/lib/usrp/usrp1/soft_time_ctrl.cpp +++ b/host/lib/usrp/usrp1/soft_time_ctrl.cpp @@ -69,6 +69,9 @@ public: _thread_group.create_thread(boost::bind(&soft_time_ctrl_impl::recv_cmd_dispatcher, this)); _update_mutex.lock(); //lock blocks until spawned _update_mutex.unlock(); //unlock mutex before done + + //initialize the time to something + this->set_time(time_spec_t(0.0)); } ~soft_time_ctrl_impl(void){ |