Enable dithering. Fix wrong expectation of return value from do_insn()
This commit is contained in:
parent
8b5cd228fa
commit
14695f8c96
1 changed files with 3 additions and 3 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Reference in a new issue