From: Frank Mori Hess Date: Sun, 6 Feb 2005 16:06:00 +0000 (+0000) Subject: force read from channel 0 when CR_ALT_SRC is set in ai read insn. X-Git-Tag: r0_7_70~55 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=5972b67481fe19399f4315250035f3b48ddb4894;p=comedi.git force read from channel 0 when CR_ALT_SRC is set in ai read insn. --- diff --git a/comedi/drivers/cb_pcidas.c b/comedi/drivers/cb_pcidas.c index 589a36d0..aec68c2b 100644 --- a/comedi/drivers/cb_pcidas.c +++ b/comedi/drivers/cb_pcidas.c @@ -783,17 +783,21 @@ static int cb_pcidas_ai_rinsn(comedi_device *dev, comedi_subdevice *s, int n,i; unsigned int bits; static const int timeout = 10000; - + int channel; // enable calibration input if appropriate if( insn->chanspec & CR_ALT_SOURCE ) + { outw( cal_enable_bits( dev ), devpriv->control_status + CALIBRATION_REG); - else + channel = 0; + }else + { outw( 0, devpriv->control_status + CALIBRATION_REG); - + channel = CR_CHAN(insn->chanspec); + } // set mux limits and gain - bits = BEGIN_SCAN(CR_CHAN(insn->chanspec)) | - END_SCAN(CR_CHAN(insn->chanspec)) | + bits = BEGIN_SCAN(channel) | + END_SCAN(channel) | GAIN_BITS(CR_RANGE(insn->chanspec)); // set unipolar/bipolar if(CR_RANGE(insn->chanspec) & IS_UNIPOLAR)