From: David Schleef Date: Fri, 5 Jul 2002 18:23:01 +0000 (+0000) Subject: Fix munging on 671x boards X-Git-Tag: r0_7_66~176 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=2c2b9e52a1e4641e92f0a6e7bbb779024a7ba3a5;p=comedi.git Fix munging on 671x boards --- diff --git a/comedi/drivers/ni_mio_common.c b/comedi/drivers/ni_mio_common.c index 77c93a7d..32c55c9a 100644 --- a/comedi/drivers/ni_mio_common.c +++ b/comedi/drivers/ni_mio_common.c @@ -1855,11 +1855,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; ni_ao_config_chanlist(dev,s,&insn->chanspec,1); - devpriv->ao[chan] = data[insn->n-1]; - ao_win_out(data[insn->n-1],DACx_Direct_Data_671x(chan)); + d = data[insn->n-1]; + devpriv->ao[chan] = d; + d -= 1 << (boardtype.aobits - 1); + ao_win_out(d,DACx_Direct_Data_671x(chan)); return insn->n; }