From: Frank Mori Hess Date: Tue, 19 Jun 2001 16:16:35 +0000 (+0000) Subject: fixed bit mangling in analog input read insn for 16 bit das802/16 X-Git-Tag: r0_7_60~160 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=146300c8c897c22a483c240547bbc69f7bfc0c23;p=comedi.git fixed bit mangling in analog input read insn for 16 bit das802/16 --- diff --git a/comedi/drivers/das800.c b/comedi/drivers/das800.c index 32e56cc2..c426daf4 100644 --- a/comedi/drivers/das800.c +++ b/comedi/drivers/das800.c @@ -858,7 +858,14 @@ static int das800_ai_rinsn(comedi_device *dev, comedi_subdevice *s, comedi_insn } lsb = inb(dev->iobase + DAS800_LSB); msb = inb(dev->iobase + DAS800_MSB); - data[n] = (lsb >> 4) | (msb << 4); + if(thisboard->resolution == 12) + { + data[n] = (lsb >> 4) & 0xff; + data[n] |= (msb << 4); + }else + { + data[n] = (msb << 8) | lsb; + } } return n;