aboutsummaryrefslogtreecommitdiffstats
path: root/host/apps/omap_debug
diff options
context:
space:
mode:
authorPhilip Balister <balister@moose.(none)>2010-05-21 10:14:03 -0400
committerPhilip Balister <balister@moose.(none)>2010-05-21 10:15:54 -0400
commit96ef5b171b44956f44e02672af8a734f3c0e38c4 (patch)
tree9369ccc596af25f34b07d4ebeb015d16e33ceff8 /host/apps/omap_debug
parent64276eabd8d88f7d72763f8b500c13a9a689cd21 (diff)
downloaduhd-96ef5b171b44956f44e02672af8a734f3c0e38c4.tar.gz
uhd-96ef5b171b44956f44e02672af8a734f3c0e38c4.tar.bz2
uhd-96ef5b171b44956f44e02672af8a734f3c0e38c4.zip
OK, now crc uses the timed interface to set the data rate.
Revert "Revert "Revert "Update test program to reflect what is in the FPGA image.""" This reverts commit b5dfe74e991d240f0e666dfd521726ec61128eb8. Conflicts: host/apps/omap_debug/usrp-e-crc-rw.c
Diffstat (limited to 'host/apps/omap_debug')
-rw-r--r--host/apps/omap_debug/usrp-e-crc-rw.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/host/apps/omap_debug/usrp-e-crc-rw.c b/host/apps/omap_debug/usrp-e-crc-rw.c
index e1d9bf0db..b0982de86 100644
--- a/host/apps/omap_debug/usrp-e-crc-rw.c
+++ b/host/apps/omap_debug/usrp-e-crc-rw.c
@@ -183,43 +183,43 @@ int main(int argc, char *argv[])
{
pthread_t tx, rx;
long int t;
+ int fpga_config_flag ,decimation;
struct usrp_e_ctl16 d;
struct sched_param s = {
.sched_priority = 1
};
- int read, write;
- if (argc < 2) {
- printf("%s r|w|rw tx_data_size\n", argv[0]);
+ if (argc < 4) {
+ printf("%s t|w|rw decimation data_size\n", argv[0]);
return -1;
}
- packet_data_length = atoi(argv[2]);
+ decimation = atoi(argv[2]);
+ packet_data_length = atoi(argv[3]);
- if (strcmp(argv[1], "r") == 0) {
- read = 1;
- write = 0;
- }
+ fp = open("/dev/usrp_e0", O_RDWR);
+ printf("fp = %d\n", fp);
- if (strcmp(argv[1], "w") == 0) {
- read = 0;
- write = 1;
- }
+ fpga_config_flag = 0;
+ if (strcmp(argv[1], "w") == 0)
+ fpga_config_flag |= (1 << 15);
+ else if (strcmp(argv[1], "r") == 0)
+ fpga_config_flag |= (1 << 14);
+ else if (strcmp(argv[1], "rw") == 0)
+ fpga_config_flag |= ((1 << 15) | (1 << 14));
- if (strcmp(argv[1], "rw") == 0) {
- read = 1;
- write = 1;
- }
+ fpga_config_flag |= decimation;
- printf("About to open /dev/usrp_e0");
- fp = open("/dev/usrp_e0", O_RDWR);
- printf("fp = %d\n", fp);
+ d.offset = 14;
+ d.count = 1;
+ d.buf[0] = fpga_config_flag;
+ ioctl(fp, USRP_E_WRITE_CTL16, &d);
sleep(1); // in case the kernel threads need time to start. FIXME if so
// sched_setscheduler(0, SCHED_RR, &s);
- if (read) {
+ if (fpga_config_flag & (1 << 14)) {
if (pthread_create(&rx, NULL, read_thread, (void *) t)) {
printf("Failed to create rx thread\n");
exit(-1);
@@ -228,7 +228,7 @@ int main(int argc, char *argv[])
sleep(1);
- if (write) {
+ if (fpga_config_flag & (1 << 15)) {
if (pthread_create(&tx, NULL, write_thread, (void *) t)) {
printf("Failed to create tx thread\n");
exit(-1);