From: David Schleef Date: Mon, 30 Sep 2002 23:48:51 +0000 (+0000) Subject: Fix 671x ao munging (again). This time, with feeling. (Or, correct X-Git-Tag: r0_7_66~82 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e4c02ce769bded6f49791593046f0a96fe39aeea;p=comedi.git Fix 671x ao munging (again). This time, with feeling. (Or, correct unipolar/bipolar behavior) --- diff --git a/comedi/drivers/ni_mio_common.c b/comedi/drivers/ni_mio_common.c index 664470d9..a97c63cd 100644 --- a/comedi/drivers/ni_mio_common.c +++ b/comedi/drivers/ni_mio_common.c @@ -1828,16 +1828,14 @@ static int ni_ao_insn_write_671x(comedi_device *dev,comedi_subdevice *s, comedi_insn *insn,lsampl_t *data) { unsigned int chan = CR_CHAN(insn->chanspec); - lsampl_t d; + unsigned int invert; - ni_ao_config_chanlist(dev,s,&insn->chanspec,1); + invert = ni_ao_config_chanlist(dev,s,&insn->chanspec,1); - d = data[insn->n-1]; - devpriv->ao[chan] = d; - d -= 1 << (boardtype.aobits - 1); - ao_win_out(d,DACx_Direct_Data_671x(chan)); + devpriv->ao[chan] = data[0]; + ao_win_out(data[0] ^ invert, DACx_Direct_Data_671x(chan)); - return insn->n; + return 1; } static int ni_ao_inttrig(comedi_device *dev,comedi_subdevice *s,