Fixed AI_START trigger for PFI inputs
authorDavid Schleef <ds@schleef.org>
Wed, 29 May 2002 04:28:22 +0000 (04:28 +0000)
committerDavid Schleef <ds@schleef.org>
Wed, 29 May 2002 04:28:22 +0000 (04:28 +0000)
comedi/drivers/ni_mio_common.c
comedi/drivers/ni_stc.h

index 352f1a6e87c35e1e1e5f27022db04d291191559f..73135df5a5a2c3f7b8c7c882b4e2cad9dc94aaea 100644 (file)
@@ -1308,7 +1308,7 @@ static int ni_ai_cmd(comedi_device *dev,comedi_subdevice *s)
 
                win_out(AI_START2_Select(0)|
                        AI_START1_Sync|AI_START1_Edge|
-                       AI_START1_Select(chan),
+                       AI_START1_Select(chan + 1),
                        AI_Trigger_Select_Register);
                break;
        }
@@ -1820,6 +1820,8 @@ static int ni_ao_config_chanlist(comedi_device *dev, comedi_subdevice *s,
                /* AREF_OTHER connects AO ground to AI ground, i think */
                conf |= (CR_AREF(chanspec[i])==AREF_OTHER)? AO_Ground_Ref : 0;
 
+               devpriv->ao_conf[chan] = conf;
+
                ni_writew(conf,AO_Configuration);
        }
 
@@ -2075,11 +2077,11 @@ static int ni_ao_cmdtest(comedi_device *dev,comedi_subdevice *s,comedi_cmd *cmd)
 
 static int ni_ao_reset(comedi_device *dev,comedi_subdevice *s)
 {
-       devpriv->ao0p=0x0000;
-       ni_writew(devpriv->ao0p,AO_Configuration);
+       //devpriv->ao0p=0x0000;
+       //ni_writew(devpriv->ao0p,AO_Configuration);
 
-       devpriv->ao1p=AO_Channel(1);
-       ni_writew(devpriv->ao1p,AO_Configuration);
+       //devpriv->ao1p=AO_Channel(1);
+       //ni_writew(devpriv->ao1p,AO_Configuration);
 
        win_out(AO_Configuration_Start,Joint_Reset_Register);
        win_out(AO_Disarm,AO_Command_1_Register);
@@ -2277,7 +2279,8 @@ static int ni_E_init(comedi_device *dev,comedi_devconfig *it)
        s->maxdata=1;
        s->insn_bits = ni_pfi_insn_bits;
        s->insn_config = ni_pfi_insn_config;
-       ni_set_bits(dev, IO_Bidirection_Pin_Register, 0x3ff, 0);
+       s->io_bits = 0;
+       win_out(s->io_bits, IO_Bidirection_Pin_Register);
 
        /* ai configuration */
        ni_ai_reset(dev,dev->subdevices+0);
@@ -3122,17 +3125,16 @@ static int ni_pfi_insn_config(comedi_device *dev,comedi_subdevice *s,
 
        switch(data[0]){
        case COMEDI_OUTPUT:
-               s->io_bits |= 1<<chan;
-               ni_set_bits(dev, IO_Bidirection_Pin_Register, (1<<chan), 1);
+               s->io_bits |= (1<<chan);
                break;
        case COMEDI_INPUT:
                s->io_bits &= ~(1<<chan);
-               ni_set_bits(dev, IO_Bidirection_Pin_Register, (1<<chan), 0);
                break;
        default:
                return -EINVAL;
        }
 
+       win_out(s->io_bits, IO_Bidirection_Pin_Register);
        return 1;
 }
 
index bbf2a2dd6024af47a8f7b828ed35be97a3472dd3..fe669a77903a691045798402d4faca67efc8db14 100644 (file)
@@ -660,6 +660,7 @@ static ni_board ni_boards[];
        unsigned short ao[2];                                   \
        unsigned short caldacs[12];                             \
                                                                \
+       unsigned short ao_conf[2];                              \
        unsigned short ao_mode1;                                \
        unsigned short ao_mode2;                                \
        unsigned short ao_mode3;                                \