aboutsummaryrefslogtreecommitdiffstats
path: root/host/examples
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-01-24 10:58:34 -0800
committerJosh Blum <josh@joshknows.com>2011-01-24 10:58:34 -0800
commit9e2d669de18b40a69b212175bf1e6f44ad7cc5bc (patch)
treede3003da8d8898cd10e83803964eb99f3d63995d /host/examples
parentff796f519df11111f028a505125ce95f060c897e (diff)
downloaduhd-9e2d669de18b40a69b212175bf1e6f44ad7cc5bc.tar.gz
uhd-9e2d669de18b40a69b212175bf1e6f44ad7cc5bc.tar.bz2
uhd-9e2d669de18b40a69b212175bf1e6f44ad7cc5bc.zip
usrp1: changes that make benchmark rx work
initialize the time to something in soft time control use std::max(0, lost) because the time is emulated, lost can be negative which means huge positive unsigned...
Diffstat (limited to 'host/examples')
-rw-r--r--host/examples/benchmark_rx_rate.cpp3
1 files changed, 2 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));