From: Frank Mori Hess Date: Wed, 29 May 2002 00:17:52 +0000 (+0000) Subject: made cb_pcidas64 external trigger configuration consistent X-Git-Tag: r0_7_65~23 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=92aa74383cf5c942f08fa6f23101fa8535548079;p=comedi.git made cb_pcidas64 external trigger configuration consistent --- diff --git a/comedi/drivers/cb_pcidas64.c b/comedi/drivers/cb_pcidas64.c index 4d345f03..3db855b8 100644 --- a/comedi/drivers/cb_pcidas64.c +++ b/comedi/drivers/cb_pcidas64.c @@ -1342,21 +1342,6 @@ static int ai_config_calibration_source( comedi_device *dev, lsampl_t *data ) return 2; } -static int ai_config_digital_trigger( comedi_device *dev, lsampl_t *data ) -{ - lsampl_t flags = data[1]; - - if( flags & DIGITAL_TRIG_RISING) - { - private(dev)->ext_trig_falling = 0; - }else - { - private(dev)->ext_trig_falling = 1; - } - - return 2; -} - static int ai_config_insn( comedi_device *dev, comedi_subdevice *s, comedi_insn *insn, lsampl_t *data) { int id = data[0]; @@ -1366,9 +1351,6 @@ static int ai_config_insn( comedi_device *dev, comedi_subdevice *s, comedi_insn case INSN_CONFIG_ALT_SOURCE: return ai_config_calibration_source( dev, data ); break; - case INSN_CONFIG_DIGITAL_TRIG: - return ai_config_digital_trigger( dev, data ); - break; default: return -EINVAL; break; @@ -1438,11 +1420,6 @@ static int ai_cmdtest(comedi_device *dev,comedi_subdevice *s, comedi_cmd *cmd) /* step 3: make sure arguments are trivially compatible */ - if(cmd->start_arg != 0) - { - cmd->start_arg = 0; - err++; - } if(cmd->convert_src == TRIG_TIMER) { if(cmd->convert_arg < board(dev)->ai_speed) @@ -1724,7 +1701,7 @@ static int ai_cmd(comedi_device *dev,comedi_subdevice *s) bits |= ADC_START_TRIG_EXT_BITS; else if(cmd->start_src == TRIG_NOW) bits |= ADC_START_TRIG_SOFT_BITS; - if( private(dev)->ext_trig_falling ) + if( cmd->start_arg & CR_INVERT ) bits |= ADC_START_TRIG_FALLING_BIT; writew(bits, private(dev)->main_iobase + ADC_CONTROL0_REG); DEBUG_PRINT("control0 bits 0x%x\n", bits); diff --git a/include/linux/comedi.h b/include/linux/comedi.h index 7841819b..7aca5a8c 100644 --- a/include/linux/comedi.h +++ b/include/linux/comedi.h @@ -63,6 +63,7 @@ typedef unsigned short sampl_t; #define CR_DITHER CR_ALT_FILTER #define CR_DEGLITCH CR_ALT_FILTER #define CR_ALT_SOURCE (1<<27) +#define CR_EDGE (1<<30) #define CR_INVERT (1<<31) #define AREF_GROUND 0x00 /* analog ref = analog ground */ @@ -216,8 +217,6 @@ typedef unsigned short sampl_t; //#define INSN_CONFIG_COUNTER 0x13 #define INSN_CONFIG_ALT_SOURCE 0x14 #define INSN_CONFIG_DIGITAL_TRIG 0x15 -// flags for INSN_CONFIG_DIGITAL_TRIG -#define DIGITAL_TRIG_RISING 0x1 /* ioctls */