From f5b63c75da5dc6fbe7e95c322b3bfda6c763b18d Mon Sep 17 00:00:00 2001 From: Frank Mori Hess Date: Thu, 15 May 2003 22:07:23 +0000 Subject: [PATCH] fix munging for pio analog input --- comedi/drivers/ni_mio_common.c | 6 ++++++ 1 file changed, 6 insertions(+) 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