summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilip Balister <philip@opensdr.com>2010-05-18 14:27:57 +0000
committerPhilip Balister <philip@opensdr.com>2010-05-18 14:29:18 +0000
commit3689cdd36c43656edc93cfee25d3bee1837f8bbd (patch)
tree60e9b377f3bbe2846d89cdd377fd5780187f6ed6
parent7d0a98fc33c17457c9f4cd8e03eddb0d559457f0 (diff)
downloaduhd-3689cdd36c43656edc93cfee25d3bee1837f8bbd.tar.gz
uhd-3689cdd36c43656edc93cfee25d3bee1837f8bbd.tar.bz2
uhd-3689cdd36c43656edc93cfee25d3bee1837f8bbd.zip
Remove rand for now. Fix bug in data rate calculation.
-rw-r--r--host/apps/omap_debug/usrp-e-crc-rw.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/host/apps/omap_debug/usrp-e-crc-rw.c b/host/apps/omap_debug/usrp-e-crc-rw.c
index f99654781..b3f8ccc90 100644
--- a/host/apps/omap_debug/usrp-e-crc-rw.c
+++ b/host/apps/omap_debug/usrp-e-crc-rw.c
@@ -114,6 +114,7 @@ static void *write_thread(void *threadid)
printf("Greetings from the write thread!\n");
+ tx_pkt_cnt = 0;
tx_data = malloc(2048);
bytes_transfered = 0;
@@ -141,7 +142,7 @@ static void *write_thread(void *threadid)
crc = 0xFFFFFFFF;
for (i = 0; i < tx_len; i++) {
- tx_data->buf[i] = rand() & 0xFF;
+ tx_data->buf[i] = i & 0xFF;
crc = ((crc >> 8) & 0x00FFFFFF) ^
crc_tab[(crc ^ tx_data->buf[i]) & 0xFF];
@@ -158,8 +159,9 @@ static void *write_thread(void *threadid)
if (bytes_transfered > (100 * 1000000)) {
gettimeofday(&finish_time, NULL);
- elapsed_seconds = start_time.tv_sec - finish_time.tv_sec;
+ elapsed_seconds = finish_time.tv_sec - start_time.tv_sec;
+ printf("%d bytes transfered in %d seconds.\n", bytes_transfered, elapsed_seconds);
printf("TX data transfer rate = %f K Bps\n",
(float) bytes_transfered / (float) elapsed_seconds / 1000);