From 146300c8c897c22a483c240547bbc69f7bfc0c23 Mon Sep 17 00:00:00 2001 From: Frank Mori Hess Date: Tue, 19 Jun 2001 16:16:35 +0000 Subject: [PATCH] fixed bit mangling in analog input read insn for 16 bit das802/16 --- comedi/drivers/das800.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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; -- 2.26.2