From: David Schleef Date: Wed, 1 Aug 2001 12:07:05 +0000 (+0000) Subject: Enable dithering. Fix wrong expectation of return value from do_insn() X-Git-Tag: r0_7_17~44 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=14695f8c96fbb7d449f9ef5b6a92a219a8407169;p=comedilib.git Enable dithering. Fix wrong expectation of return value from do_insn() --- diff --git a/comedi_calibrate/comedi_calibrate.c b/comedi_calibrate/comedi_calibrate.c index 23e663e..65361cf 100644 --- a/comedi_calibrate/comedi_calibrate.c +++ b/comedi_calibrate/comedi_calibrate.c @@ -928,12 +928,12 @@ int comedi_data_read_n(comedi_t *it,unsigned int subdev,unsigned int chan, insn.data = data; insn.subdev = subdev; insn.chanspec = CR_PACK(chan,range,aref); + /* enable dithering */ + insn.chanspec |= (1<<26); ret = comedi_do_insn(it,&insn); - /* comedi_do_insn returns the number of sucessful insns. - * Hopefully 1. */ - if(ret==1)return n; + if(ret>0)return n; printf("insn barfed: subdev=%d, chan=%d, range=%d, aref=%d, " "n=%d, ret=%d, %s\n",subdev,chan,range,aref,n,ret,