From a6f295781283ec74c87fcb217059aa8f4fd2710b Mon Sep 17 00:00:00 2001 From: David Schleef Date: Mon, 4 Sep 2000 23:09:01 +0000 Subject: [PATCH] speedup changes. --- comedi/drivers/ni_mio_common.c | 15 +++++++++++++-- comedi/drivers/ni_mio_cs.c | 3 +++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/comedi/drivers/ni_mio_common.c b/comedi/drivers/ni_mio_common.c index b08b8eb0..2e9b5d7c 100644 --- a/comedi/drivers/ni_mio_common.c +++ b/comedi/drivers/ni_mio_common.c @@ -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"); } diff --git a/comedi/drivers/ni_mio_cs.c b/comedi/drivers/ni_mio_cs.c index c21aaa2c..e004343b 100644 --- a/comedi/drivers/ni_mio_cs.c +++ b/comedi/drivers/ni_mio_cs.c @@ -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; -- 2.26.2