speedup changes.
authorDavid Schleef <ds@schleef.org>
Mon, 4 Sep 2000 23:09:01 +0000 (23:09 +0000)
committerDavid Schleef <ds@schleef.org>
Mon, 4 Sep 2000 23:09:01 +0000 (23:09 +0000)
comedi/drivers/ni_mio_common.c
comedi/drivers/ni_mio_cs.c

index b08b8eb0eead7b1c81164a77eef401a189a830e1..2e9b5d7c206968bb900dd37578ec110c6cc4b9fa 100644 (file)
@@ -575,6 +575,17 @@ static void ni_load_channelgain_list(comedi_device *dev,unsigned int n_chan,unsi
        unsigned int hi,lo;
        unsigned short sign;
 
+       if(n_chan==1){
+               if(devpriv->changain_state && devpriv->changain_spec==list[0]){
+                       // ready to go.
+                       return;
+               }
+               devpriv->changain_state=1;
+               devpriv->changain_spec=list[0];
+       }else{
+               devpriv->changain_state=0;
+       }
+       
        win_out(1,Configuration_Memory_Clear);
 
        sign=1<<(boardtype.adbits-1);
@@ -597,12 +608,12 @@ static void ni_load_channelgain_list(comedi_device *dev,unsigned int n_chan,unsi
        /* prime the channel/gain list */
 
        win_out(1,AI_Command_1_Register);
-       for(i=0;i<40;i++){
+       for(i=0;i<1000;i++){
                if(!(ni_readw(AI_Status_1)&AI_FIFO_Empty_St)){
                        win_out(1,ADC_FIFO_Clear);
                        return;
                }
-               udelay(25);
+               //udelay(25);
        }
        rt_printk("ni_E: timeout 1\n");
 }
index c21aaa2cea340a9b2e78491d2cae73d890715cf9..e004343bd5b38f571959f12fc62a0c3820e7bd40 100644 (file)
@@ -142,6 +142,9 @@ typedef struct{
        int irqmask;
        int aimode;
 
+int changain_state;
+unsigned int changain_spec;
+
        unsigned short ao_mode1;
        unsigned short ao_mode2;
        unsigned short ao_mode3;