From 748980971df2e77bea40fc2caf9f719843a5efe7 Mon Sep 17 00:00:00 2001 From: David Schleef Date: Sat, 27 May 2000 00:56:45 +0000 Subject: [PATCH] many random changes --- Makefile | 4 ++-- demo/Makefile | 2 +- demo/ao_waveform.c | 2 +- demo/cmd.c | 2 +- demo/info.c | 21 +++++++++++++++++++-- lib/filler.c | 6 +++++- perl/lperl | 2 +- 7 files changed, 30 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 2adaf01..0bc9d39 100644 --- a/Makefile +++ b/Makefile @@ -27,8 +27,8 @@ install: dummy (cd include;install -m 644 comedilib.h ${INSTALLDIR}/include) (cd include;install -m 644 comedi.h ${INSTALLDIR}/include) install lib/libcomedi.so.${version} ${INSTALLDIR_LIB} - (cd $(INSTALLDIR_LIB);ln -s libcomedi.so.${version} libcomedi.so.${MAJOR}) - (cd $(INSTALLDIR_LIB);ln -s libcomedi.so.${version} libcomedi.so) + (cd $(INSTALLDIR_LIB);ln -sf libcomedi.so.${version} libcomedi.so.${MAJOR}) + (cd $(INSTALLDIR_LIB);ln -sf libcomedi.so.${version} libcomedi.so) install -m 644 lib/libcomedi.a ${INSTALLDIR_LIB} #/sbin/ldconfig -n ${INSTALLDIR}/lib install -d ${INSTALLDIR_DOC} diff --git a/demo/Makefile b/demo/Makefile index e4d2e08..d8912cb 100644 --- a/demo/Makefile +++ b/demo/Makefile @@ -5,7 +5,7 @@ CFLAGS +=-I ../include -I . -O2 LDFLAGS=-L../lib/ -lcomedi -lm -BINS=mode4 mode3 mode2 ao_waveform tut2 cmd tut1 +BINS=mode4 mode3 mode2 ao_waveform tut2 cmd tut1 antialias MBINS=inp inpn sv eeprom_dump info outp all: $(patsubst %,_mbins_%,$(MBINS)) $(patsubst %,_bins_%,$(BINS)) diff --git a/demo/ao_waveform.c b/demo/ao_waveform.c index 09c8485..6aeb4ee 100644 --- a/demo/ao_waveform.c +++ b/demo/ao_waveform.c @@ -52,7 +52,7 @@ double waveform_frequency = 100.0; /* update rate for the DAC, typically much higher than the frequency of the sine wave. */ -double update_frequency = 200000.0; +double update_frequency = 50000.0; /* peak-to-peak amplitude, in DAC units (i.e., 0-4095) */ double amplitude = 4000; diff --git a/demo/cmd.c b/demo/cmd.c index 892ef61..7cb85e1 100644 --- a/demo/cmd.c +++ b/demo/cmd.c @@ -62,7 +62,7 @@ static void do_cmd(comedi_t *dev) cmd.start_src = TRIG_NOW; cmd.start_arg = 0; - cmd.scan_begin_src = TRIG_TIMER; + cmd.scan_begin_src = TRIG_FOLLOW; cmd.scan_begin_arg = 1; /* in ns */ cmd.convert_src = TRIG_TIMER; diff --git a/demo/info.c b/demo/info.c index 0040d7d..093f3fb 100644 --- a/demo/info.c +++ b/demo/info.c @@ -38,8 +38,11 @@ extern char *filename; int main(int argc,char *argv[]) { - int i; + int i,j; int n_subdevices,type; + int chan,n_chans; + int n_ranges; + comedi_range *rng; parse_options(argc,argv); @@ -59,8 +62,22 @@ int main(int argc,char *argv[]) printf("subdevice %d:\n",i); type=comedi_get_subdevice_type(it,i); printf(" type: %d (%s)\n",type,subdevice_types[type]); - printf(" number of channels: %d\n",comedi_get_n_channels(it,i)); + n_chans=comedi_get_n_channels(it,i); + printf(" number of channels: %d\n",n_chans); printf(" max data value: %d\n",comedi_get_maxdata(it,i,0)); + n_ranges=comedi_get_n_ranges(it,i,0); + printf(" number of ranges: %d\n",n_ranges); + printf(" ranges:\n"); + for(chan=0;chanmin,rng->max); + } + printf("\n"); + } } return 0; diff --git a/lib/filler.c b/lib/filler.c index dde1e0e..bc3f464 100644 --- a/lib/filler.c +++ b/lib/filler.c @@ -102,12 +102,16 @@ comedi_range *get_rangeinfo(int fd,unsigned int range_type) { comedi_krange *kr; comedi_range *r; + int ret; int i; kr=malloc(sizeof(comedi_krange)*RANGE_LENGTH(range_type)); r=malloc(sizeof(comedi_range)*RANGE_LENGTH(range_type)); - ioctl_rangeinfo(fd,range_type,kr); + ret=ioctl_rangeinfo(fd,range_type,kr); + if(ret<0){ + fprintf(stderr,"ioctl_rangeinfo(%d,0x%08x,%p)\n",fd,range_type,kr); + } for(i=0;i