From 40b8aa0f6d6a64679b7c8c28ab9c16b209fed308 Mon Sep 17 00:00:00 2001 From: Frank Mori Hess Date: Sun, 24 Jun 2001 01:45:03 +0000 Subject: [PATCH] fixed a bug I created --- comedi/drivers/cb_pcidas.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/comedi/drivers/cb_pcidas.c b/comedi/drivers/cb_pcidas.c index 47b57196..ebf9c7ea 100644 --- a/comedi/drivers/cb_pcidas.c +++ b/comedi/drivers/cb_pcidas.c @@ -116,8 +116,8 @@ Asynchronous analog input support added by Frank Mori Hess. #define ADC8254 0 #define DIO_8255 4 -// bit in hexadecimal representation of range index that indicates bipolar range -#define IS_BIPOLAR 0x4 +// bit in hexadecimal representation of range index that indicates unipolar range +#define IS_UNIPOLAR 0x4 comedi_lrange cb_pcidas_ranges = { 8, @@ -592,10 +592,10 @@ static int cb_pcidas_ai_rinsn(comedi_device *dev, comedi_subdevice *s, command |= SE; /* input signals range */ - if (CR_RANGE(insn->chanspec) & IS_BIPOLAR) - command |= CR_RANGE(insn->chanspec) << 8; - else + if (CR_RANGE(insn->chanspec) & IS_UNIPOLAR) command |= UNIP | GAIN_BITS(CR_RANGE(insn->chanspec)); + else + command |= GAIN_BITS(CR_RANGE(insn->chanspec)); /* write channel to multiplexer */ command |= CR_CHAN(insn->chanspec) | (CR_CHAN(insn->chanspec) << 4); @@ -786,7 +786,7 @@ static int cb_pcidas_ai_cmd(comedi_device *dev,comedi_subdevice *s) END_SCAN(CR_CHAN(cmd->chanlist[cmd->chanlist_len - 1])) | GAIN_BITS(CR_RANGE(cmd->chanlist[0])); // set unipolar/bipolar - if((CR_RANGE(cmd->chanlist[0]) & IS_BIPOLAR) == 0) + if(CR_RANGE(cmd->chanlist[0]) & IS_UNIPOLAR) bits |= UNIP; // set singleended/differential if(CR_AREF(cmd->chanlist[0]) != AREF_DIFF) -- 2.26.2