From 3689cdd36c43656edc93cfee25d3bee1837f8bbd Mon Sep 17 00:00:00 2001 From: Philip Balister Date: Tue, 18 May 2010 14:27:57 +0000 Subject: Remove rand for now. Fix bug in data rate calculation. --- host/apps/omap_debug/usrp-e-crc-rw.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'host/apps/omap_debug') 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); -- cgit v1.2.3