From: Frank Mori Hess Date: Wed, 5 Mar 2003 17:01:34 +0000 (+0000) Subject: set default n_scan value to 10 for insn demo, added check that it is X-Git-Tag: r0_7_21~243 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=26769e5635a3e357072398c32cafaafeb5fafc3b;p=comedilib.git set default n_scan value to 10 for insn demo, added check that it is not set larger than MAX_SAMPLES --- diff --git a/demo/insn.c b/demo/insn.c index 80f1d67..33978bc 100644 --- a/demo/insn.c +++ b/demo/insn.c @@ -48,7 +48,12 @@ int main(int argc, char *argv[]) struct timeval t1,t2; lsampl_t data[MAX_SAMPLES]; + n_scan = 10; /* override default n_scan value to something more suitable */ parse_options(argc,argv); + if( n_scan > MAX_SAMPLES ){ + fprintf( stderr, "Requested too many samples, reducing to %i\n", MAX_SAMPLES ); + n_scan = MAX_SAMPLES; + } device=comedi_open(filename); if(!device){