diff options
author | Philip Balister <philip@opensdr.com> | 2010-09-21 19:59:02 +0000 |
---|---|---|
committer | Philip Balister <philip@opensdr.com> | 2010-09-21 19:59:02 +0000 |
commit | 943bfa271c97b36dcba74f1d65220e6f66f50c7f (patch) | |
tree | b2fe6a33ff87a5c4d40a93ff96719c364c5f70a6 | |
parent | 380889798a9a9b5319e708743c5bb216405f77f4 (diff) | |
download | uhd-943bfa271c97b36dcba74f1d65220e6f66f50c7f.tar.gz uhd-943bfa271c97b36dcba74f1d65220e6f66f50c7f.tar.bz2 uhd-943bfa271c97b36dcba74f1d65220e6f66f50c7f.zip |
Use the ring buffer sizes read from the kernel.
-rw-r--r-- | host/apps/omap_debug/usrp-e-mm-loopback.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/host/apps/omap_debug/usrp-e-mm-loopback.c b/host/apps/omap_debug/usrp-e-mm-loopback.c index 81bdb410a..053f60b60 100644 --- a/host/apps/omap_debug/usrp-e-mm-loopback.c +++ b/host/apps/omap_debug/usrp-e-mm-loopback.c @@ -27,6 +27,7 @@ struct pkt (*rx_buf)[200]; struct pkt (*tx_buf)[200]; static int fp; +static struct usrp_e_ring_buffer_size_t rb_size; static int calc_checksum(struct pkt *p) { @@ -110,7 +111,7 @@ static void *read_thread(void *threadid) (*rxi)[rb_read].flags = RB_KERNEL; rb_read++; - if (rb_read == 100) + if (rb_read == rb_size.num_rx_frames) rb_read = 0; bytes_transfered += cnt; @@ -177,7 +178,7 @@ static void *write_thread(void *threadid) (*txi)[rb_write].flags = RB_USER; rb_write++; - if (rb_write == 100) + if (rb_write == rb_size.num_tx_frames) rb_write = 0; // cnt = write(fp, tx_data, p->len * 2 + 12); @@ -195,7 +196,6 @@ int main(int argc, char *argv[]) struct sched_param s = { .sched_priority = 1 }; - struct usrp_e_ring_buffer_size_t rb_size; int ret, map_size, page_size; void *rb; |