From: David Schleef Date: Tue, 12 Jun 2001 10:41:09 +0000 (+0000) Subject: Added realtime command line option. Fixed tests to use realtime X-Git-Tag: r0_7_16~70 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e93771f21993aa1c5266e52d473972c123c96c01;p=comedilib.git Added realtime command line option. Fixed tests to use realtime flag. Added internal trigger test. --- diff --git a/testing/cmd_1.c b/testing/cmd_1.c index a5de50d..d4e71e3 100644 --- a/testing/cmd_1.c +++ b/testing/cmd_1.c @@ -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; diff --git a/testing/cmd_2.c b/testing/cmd_2.c index fb0c15a..667050a 100644 --- a/testing/cmd_2.c +++ b/testing/cmd_2.c @@ -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; diff --git a/testing/comedi_test.h b/testing/comedi_test.h index 319dbc8..58f084d 100644 --- a/testing/comedi_test.h +++ b/testing/comedi_test.h @@ -11,5 +11,7 @@ extern int verbose; extern unsigned int capabilities; +extern int realtime; + #endif diff --git a/testing/main.c b/testing/main.c index 7d0669d..039bfc1 100644 --- a/testing/main.c +++ b/testing/main.c @@ -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); diff --git a/testing/mmap.c b/testing/mmap.c index d0a94ea..7f15175 100644 --- a/testing/mmap.c +++ b/testing/mmap.c @@ -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; diff --git a/testing/select.c b/testing/select.c index 206ff3d..bd68c20 100644 --- a/testing/select.c +++ b/testing/select.c @@ -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;