Enable dithering. Fix wrong expectation of return value from do_insn()

This commit is contained in:
David Schleef 2001-08-01 12:07:05 +00:00
parent 8b5cd228fa
commit 14695f8c96

View 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,