Enable dithering. Fix wrong expectation of return value from do_insn()
authorDavid Schleef <ds@schleef.org>
Wed, 1 Aug 2001 12:07:05 +0000 (12:07 +0000)
committerDavid Schleef <ds@schleef.org>
Wed, 1 Aug 2001 12:07:05 +0000 (12:07 +0000)
comedi_calibrate/comedi_calibrate.c

index 23e663e2c188a56e14b48f19e7b2de32473ae4d8..65361cf957af4909385a601adc54a94aac7179ed 100644 (file)
@@ -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,