Added realtime command line option. Fixed tests to use realtime
authorDavid Schleef <ds@schleef.org>
Tue, 12 Jun 2001 10:41:09 +0000 (10:41 +0000)
committerDavid Schleef <ds@schleef.org>
Tue, 12 Jun 2001 10:41:09 +0000 (10:41 +0000)
flag.  Added internal trigger test.

testing/cmd_1.c
testing/cmd_2.c
testing/comedi_test.h
testing/main.c
testing/mmap.c
testing/select.c

index a5de50d51c881eae55d567e65980ea532de02e8e..d4e71e3c786cb1030fa0a7125d77ea298024f701 100644 (file)
@@ -120,6 +120,7 @@ int test_cmd_read_fast_1chan(void)
                return 0;
        }
 
+       if(realtime)cmd.flags |= TRIG_RT;
        cmd.chanlist = chanlist;
        cmd.scan_end_arg = 1;
        cmd.stop_arg = 100000;
index fb0c15a8bcdbb30fa8c96c54c3787b908677a632..667050ab858f153758e10332120c24dc11d1b459 100644 (file)
@@ -47,6 +47,8 @@ static int get_chunks_per_length(int length)
                return 0;
        }
 
+       if(realtime)cmd.flags |= TRIG_RT;
+
        cmd.chanlist = chanlist;
        cmd.scan_end_arg = 1;
        cmd.stop_arg = length;
index 319dbc804f7988790d023212b8f10a4a8c43ff50..58f084d3ff382415100a3ddea7e74dff40fb8658 100644 (file)
@@ -11,5 +11,7 @@ extern int verbose;
 
 extern unsigned int capabilities;
 
+extern int realtime;
+
 #endif
 
index 7d0669dbbada470c147266cc5a28f238f4541f64..039bfc13f8d9ccb9f144f9ff19a6191fe2accc8b 100644 (file)
@@ -33,6 +33,7 @@ int test_cmd_probe_fast_1chan(void);
 int test_cmd_read_fast_1chan(void);
 int test_cmd_logic_bug(void);
 int test_cmd_fifo_depth_check(void);
+int test_cmd_start_inttrig(void);
 int test_mmap(void);
 int test_read_select(void);
 int test_cmd_continuous(void);
@@ -57,6 +58,7 @@ struct test_struct tests[]={
        { "cmd_read_fast_1chan", test_cmd_read_fast_1chan, TEST_STD },
        { "cmd_logic_bug", test_cmd_logic_bug, TEST_STD },
        { "cmd_fifo_depth_check", test_cmd_fifo_depth_check, TEST_STD },
+       { "cmd_start_inttrig", test_cmd_start_inttrig, TEST_STD },
        { "mmap", test_mmap, TEST_STD },
        { "read_select", test_read_select, TEST_STD },
        { "cmd_continuous", test_cmd_continuous, TEST_NEVER },
@@ -67,6 +69,7 @@ static int n_tests = sizeof(tests)/sizeof(tests[0]);
 int only_subdevice;
 int verbose;
 char *only_test;
+int realtime;
 
 static void get_capabilities(unsigned int subd);
 static void print_device_info(void);
@@ -77,13 +80,16 @@ int main(int argc, char *argv[])
        int i;
 
        while (1) {
-               c = getopt(argc, argv, "f:s:t:v");
+               c = getopt(argc, argv, "f:rs:t:v");
                if (c == -1)
                        break;
                switch (c) {
                case 'f':
                        filename = optarg;
                        break;
+               case 'r':
+                       realtime = 1;
+                       break;
                case 's':
                        only_subdevice = 1;
                        sscanf(optarg,"%d",&subdevice);
index d0a94ea337a58c42dded83507e3bab8da2fe1470..7f1517541319c47390196ae7500866ea70cccff0 100644 (file)
@@ -94,6 +94,8 @@ int test_mmap(void)
                }
        }
 
+       if(realtime)cmd.flags |= TRIG_RT;
+
        cmd.chanlist = chanlist;
        cmd.scan_end_arg = 1;
        cmd.stop_arg = N_SAMPLES;
index 206ff3dbb126d99c7c8343fd23d4f060e847599e..bd68c2078cf6eb4a28f5a826244fb53c36b98e17 100644 (file)
@@ -38,6 +38,8 @@ int test_read_select(void)
                return 0;
        }
 
+       if(realtime)cmd.flags |= TRIG_RT;
+
        cmd.chanlist = chanlist;
        cmd.scan_end_arg = 1;
        cmd.stop_arg = length;