From 26769e5635a3e357072398c32cafaafeb5fafc3b Mon Sep 17 00:00:00 2001 From: Frank Mori Hess Date: Wed, 5 Mar 2003 17:01:34 +0000 Subject: [PATCH] set default n_scan value to 10 for insn demo, added check that it is not set larger than MAX_SAMPLES --- demo/insn.c | 5 +++++ 1 file changed, 5 insertions(+) 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){ -- 2.26.2