From: Frank Mori Hess Date: Thu, 15 May 2003 22:07:23 +0000 (+0000) Subject: fix munging for pio analog input X-Git-Tag: r0_7_67x~33 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f5b63c75da5dc6fbe7e95c322b3bfda6c763b18d;p=comedi.git fix munging for pio analog input --- diff --git a/comedi/drivers/ni_mio_common.c b/comedi/drivers/ni_mio_common.c index 0e0af9da..7dfb1973 100644 --- a/comedi/drivers/ni_mio_common.c +++ b/comedi/drivers/ni_mio_common.c @@ -839,16 +839,22 @@ static void ni_ai_fifo_read(comedi_device *dev,comedi_subdevice *s, /* This may get the hi/lo data in the wrong order */ data = (dl>>16) & 0xffff; + data += devpriv->ai_offset[ async->cur_chan++ ]; err &= comedi_buf_put(s->async, data); + async->cur_chan %= async->cmd.chanlist_len; data = dl & 0xffff; + data += devpriv->ai_offset[ async->cur_chan++ ]; err &= comedi_buf_put(s->async, data); + async->cur_chan %= async->cmd.chanlist_len; } /* Check if there's a single sample stuck in the FIFO */ if( n % 2){ dl=ni_readl(ADC_FIFO_Data_611x); data = dl & 0xffff; + data += devpriv->ai_offset[ async->cur_chan++ ]; err &= comedi_buf_put(s->async, data); + async->cur_chan %= async->cmd.chanlist_len; } }else{ for(i=0;i