diff options
author | Philip Balister <philip@opensdr.com> | 2010-04-28 13:07:22 +0000 |
---|---|---|
committer | Philip Balister <philip@opensdr.com> | 2010-04-28 13:07:22 +0000 |
commit | f2454f90023552c00b5b25aca4e8eaa8d46c0751 (patch) | |
tree | 3a24a7ed0721a43bc28607caaef3887a73144f4e /host/apps/omap_debug/usrp-e-fpga-rw.c | |
parent | 7dba88b257f6a0fd5c35677ed5c7ce577cebbc74 (diff) | |
download | uhd-f2454f90023552c00b5b25aca4e8eaa8d46c0751.tar.gz uhd-f2454f90023552c00b5b25aca4e8eaa8d46c0751.tar.bz2 uhd-f2454f90023552c00b5b25aca4e8eaa8d46c0751.zip |
Various updates to test programs.
Diffstat (limited to 'host/apps/omap_debug/usrp-e-fpga-rw.c')
-rw-r--r-- | host/apps/omap_debug/usrp-e-fpga-rw.c | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/host/apps/omap_debug/usrp-e-fpga-rw.c b/host/apps/omap_debug/usrp-e-fpga-rw.c index 455657203..f3fa1499a 100644 --- a/host/apps/omap_debug/usrp-e-fpga-rw.c +++ b/host/apps/omap_debug/usrp-e-fpga-rw.c @@ -38,6 +38,8 @@ static void *read_thread(void *threadid) int cnt, prev_seq_num; struct usrp_transfer_frame *rx_data; struct pkt *p; + int rx_pkt_cnt; + int i; printf("Greetings from the reading thread!\n"); @@ -51,23 +53,39 @@ static void *read_thread(void *threadid) prev_seq_num = 0; + rx_pkt_cnt = 0; + while (1) { cnt = read(fp, rx_data, 2048); if (cnt < 0) printf("Error returned from read: %d\n", cnt); + rx_pkt_cnt++; + + if (rx_pkt_cnt == 512) { + printf("."); + fflush(stdout); + rx_pkt_cnt = 0; + } + if (rx_data->flags & RB_OVERRUN) + printf("RX ring buffer overrun occurred at packet %d\n", rx_pkt_cnt); + +// for (i = 0; i < 10; i++) +// printf(" %d", p->data[i]); +// printf("\n"); + // printf("Packet received, flags = %X, len = %d\n", rx_data->flags, rx_data->len); // printf("p->seq_num = %d\n", p->seq_num); - if (p->seq_num != prev_seq_num + 1) - printf("Sequence number fail, current = %X, previous = %X\n", - p->seq_num, prev_seq_num); - prev_seq_num = p->seq_num; +// if (p->seq_num != prev_seq_num + 1) +// printf("Sequence number fail, current = %X, previous = %X\n", +// p->seq_num, prev_seq_num); +// prev_seq_num = p->seq_num; - if (calc_checksum(p) != p->checksum) - printf("Checksum fail packet = %X, expected = %X\n", - calc_checksum(p), p->checksum); +// if (calc_checksum(p) != p->checksum) +// printf("Checksum fail packet = %X, expected = %X\n", +// calc_checksum(p), p->checksum); // printf("\n"); } |