From: David Schleef Date: Tue, 5 Sep 2000 18:14:24 +0000 (+0000) Subject: removed X-Git-Tag: r0_7_11~3 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=68a2f02a792b7a475dbe2f2a361d37a35e1be2a4;p=comedilib.git removed --- diff --git a/demo/mode1.c b/demo/mode1.c deleted file mode 100644 index 9f77244..0000000 --- a/demo/mode1.c +++ /dev/null @@ -1,89 +0,0 @@ -/* - A little input demo for mode 1 - - Mode 1 uses a timer to acquire samples at regular intervals. - It scans through the channel list, and then repeats. - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#define N_SAMPLES 100000 -#define N_CHANS 4 - -int subdevice = 0; -int channels[N_CHANS] = { 0, 1, 2, 3 }; -double freq = 100000; -int range = 0; -int aref = 3; -int external_trigger_number = 0; - -sampl_t data[N_SAMPLES]; - - -int main(int argc, char *argv[]) -{ - char *fn = NULL; - comedi_trig it; - int err; - int n,i; - comedi_t *dev; - unsigned int chan[N_CHANS]; - double actual_freq; - void *data_ptr; - int n_left; - - fn = "/dev/comedi0"; - - dev = comedi_open(fn); - - it.subdev = 0; - it.mode = 1; - it.flags = 0; - it.n_chan = N_CHANS; - it.chanlist = chan; - it.data = data; - it.n = N_SAMPLES/N_CHANS; - it.trigsrc = 0; - - /* convert the frequency into a timer value */ - comedi_get_timer(dev,subdevice,freq,&it.trigvar,&actual_freq); - printf("primary actual frequency=%g timer value=%d\n",actual_freq,it.trigvar); - - /* pack the channel list */ - for(i=0;i0){ - if((n=read(comedi_fileno(dev),data_ptr,n_left))<0){ - perror("read"); - exit(1); - } - printf("read %d\n",n); - n_left-=n; - data_ptr+=n; - } - printf("number of samples read=%d\ndata[0]=%d\ndata[N-1]=%d\n", - n/sizeof(sampl_t),data[0],data[N_SAMPLES-1]); - - for(i=0;i