From 5972b67481fe19399f4315250035f3b48ddb4894 Mon Sep 17 00:00:00 2001 From: Frank Mori Hess Date: Sun, 6 Feb 2005 16:06:00 +0000 Subject: [PATCH] force read from channel 0 when CR_ALT_SRC is set in ai read insn. --- comedi/drivers/cb_pcidas.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) 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) -- 2.26.2