made cb_pcidas64 external trigger configuration consistent
authorFrank Mori Hess <fmhess@speakeasy.net>
Wed, 29 May 2002 00:17:52 +0000 (00:17 +0000)
committerFrank Mori Hess <fmhess@speakeasy.net>
Wed, 29 May 2002 00:17:52 +0000 (00:17 +0000)
comedi/drivers/cb_pcidas64.c
include/linux/comedi.h

index 4d345f0303bbafe6786f2f1f643be42cd1a161ac..3db855b823744b7c6c8cafe6f2c4a67970084945 100644 (file)
@@ -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);
index 7841819b72c7420465f4110168e07d07150fd7fd..7aca5a8c2774a2f8063fa6cdcec9f8a7278b5e5b 100644 (file)
@@ -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 */