From 820632f30f744ab1186c15fd1f3342f5ee2abec9 Mon Sep 17 00:00:00 2001 From: Ian Abbott Date: Thu, 24 May 2007 12:41:40 +0000 Subject: [PATCH] Applied patch from Calin A. Culianu for bug #254. The MUX for the AI subdevice was being programmed incorrectly for synchronous acquisition of more than one AI channel. --- comedi/drivers/pcmmio.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/comedi/drivers/pcmmio.c b/comedi/drivers/pcmmio.c index 5902a544..0c2d7fbb 100644 --- a/comedi/drivers/pcmmio.c +++ b/comedi/drivers/pcmmio.c @@ -24,7 +24,7 @@ Driver: pcmmio.o Description: A driver for the PCM-MIO multifunction board Devices: [Winsystems] PCM-MIO (pcmmio) Author: Calin Culianu -Updated: Tue, 30 Jan 2007 16:04:41 -0500 +Updated: Wed, May 16 2007 16:21:10 -0500 Status: works A driver for the relatively new PCM-MIO multifunction board from @@ -1160,12 +1160,13 @@ static int ai_rinsn(comedi_device *dev, comedi_subdevice *s, comedi_insn *insn, /* need to do this twice to make sure mux settled */ outb(command_byte, iobase + iooffset + 2); /* chan/range/aref select */ - (void)inb(iobase+iooffset+0); /* discard junk lo byte */ - (void)inb(iobase+iooffset+1); /* discard junk hi byte */ adc_wait_ready(iobase + iooffset); /* wait for the adc to say it finised the conversion */ outb(command_byte, iobase + iooffset + 2); /* select the chan/range/aref AGAIN */ + + adc_wait_ready(iobase + iooffset); + sample = inb(iobase+iooffset+0); /* read data lo byte */ sample |= inb(iobase+iooffset+1)<<8; /* read data hi byte */ sample += adc_adjust; /* adjustment .. munge data */ -- 2.26.2