From 794c66ef2d1240985258736d1ce0e98dd6d068c8 Mon Sep 17 00:00:00 2001 From: Frank Mori Hess Date: Mon, 13 May 2002 04:07:31 +0000 Subject: [PATCH] 6402 and 6025 attach opposite meanings to single-ended/differential bit --- comedi/drivers/cb_pcidas64.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/comedi/drivers/cb_pcidas64.c b/comedi/drivers/cb_pcidas64.c index 852c6a26..75d5c641 100644 --- a/comedi/drivers/cb_pcidas64.c +++ b/comedi/drivers/cb_pcidas64.c @@ -1225,7 +1225,8 @@ static int ai_rinsn(comedi_device *dev,comedi_subdevice *s,comedi_insn *insn,lsa // set gain bits |= board(dev)->ai_range_bits[CR_RANGE(insn->chanspec)]; // set single-ended / differential - if(aref != AREF_DIFF) + if( ( board(dev)->layout == LAYOUT_64XX && aref != AREF_DIFF ) || + ( board(dev)->layout == LAYOUT_60XX && aref == AREF_DIFF ) ) bits |= ADC_SE_DIFF_BIT; if( aref == AREF_COMMON) bits |= ADC_COMMON_BIT; @@ -1330,7 +1331,10 @@ static int ai_config_calibration_source( comedi_device *dev, lsampl_t *data ) lsampl_t source = data[1]; if(source >= num_calibration_sources) + { + printk( "invalid calibration source: %i\n", source ); return -EINVAL; + } DEBUG_PRINT("setting calibration source to %i\n", source); private(dev)->calibration_source = source; @@ -1614,7 +1618,8 @@ static int ai_cmd(comedi_device *dev,comedi_subdevice *s) // set gain bits |= board(dev)->ai_range_bits[CR_RANGE(cmd->chanlist[i])]; // set single-ended / differential - if(CR_AREF(cmd->chanlist[i]) != AREF_DIFF) + if( ( board(dev)->layout == LAYOUT_64XX && CR_AREF(cmd->chanlist[i]) != AREF_DIFF ) || + ( board(dev)->layout == LAYOUT_60XX && CR_AREF(cmd->chanlist[i]) == AREF_DIFF ) ) bits |= ADC_SE_DIFF_BIT; if(CR_AREF(cmd->chanlist[i]) == AREF_COMMON) bits |= ADC_COMMON_BIT; -- 2.26.2