From 2c2b9e52a1e4641e92f0a6e7bbb779024a7ba3a5 Mon Sep 17 00:00:00 2001 From: David Schleef Date: Fri, 5 Jul 2002 18:23:01 +0000 Subject: [PATCH] Fix munging on 671x boards --- comedi/drivers/ni_mio_common.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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; } -- 2.26.2