int chan;
int msb,lsb;
- /* clear crap */
- inb(dev->iobase+DAS16_AI_LSB);
- inb(dev->iobase+DAS16_AI_MSB);
-
/* set multiplexer */
chan = CR_CHAN(insn->chanspec);
- outb_p(chan,dev->iobase+DAS16_MUX);
+ chan |= CR_CHAN(insn->chanspec) << 4;
+ outb(chan,dev->iobase+DAS16_MUX);
/* set gain */
if(thisboard->ai_pg != das16_pg_none){
msb = inb(dev->iobase + DAS16_AI_MSB);
lsb = inb(dev->iobase + DAS16_AI_LSB);
if(thisboard->ai_nbits==12){
- data[n] = (lsb>>4) | (msb << 4);
+ data[n] = ((lsb >> 4) & 0xff) | (msb << 4);
}else{
data[n] = lsb | (msb << 8);
}
int status;
unsigned long flags;
comedi_device *dev = d;
- comedi_subdevice *s = dev->subdevices;
+ comedi_subdevice *s = dev->read_subdev;
comedi_async *async;
unsigned int max_points, num_points, residue, leftover;
sampl_t dpnt;