undid some changes i made recently to placement of interrupt clearing
authorFrank Mori Hess <fmhess@speakeasy.net>
Thu, 23 Aug 2001 09:06:23 +0000 (09:06 +0000)
committerFrank Mori Hess <fmhess@speakeasy.net>
Thu, 23 Aug 2001 09:06:23 +0000 (09:06 +0000)
in interrupt handlers

comedi/drivers/cb_pcidas.c
comedi/drivers/das1800.c

index 2107a165ec2950cd18db993cad7752f331ff5698..78441930f9442c7b25f8b8b417f697802672b181 100644 (file)
@@ -1281,8 +1281,6 @@ static void cb_pcidas_interrupt(int irq, void *d, struct pt_regs *regs)
        // if fifo half-full
        if(status & ADHFI)
        {
-               // clear half-full interrupt latch
-               outw(devpriv->adc_fifo_bits | INT, devpriv->control_status + INT_ADCFIFO);
                // read data
                insw(devpriv->adc_fifo + ADCDATA, data, half_fifo);
                for(i = 0; i < half_fifo; i++)
@@ -1299,11 +1297,11 @@ static void cb_pcidas_interrupt(int irq, void *d, struct pt_regs *regs)
                        }
                }
                async->events |= COMEDI_CB_BLOCK;
+               // clear half-full interrupt latch
+               outw(devpriv->adc_fifo_bits | INT, devpriv->control_status + INT_ADCFIFO);
        // else if fifo not empty
        }else if(status & (ADNEI | EOBI))
        {
-               // clear not-empty interrupt latch
-               outw(devpriv->adc_fifo_bits | INT, devpriv->control_status + INT_ADCFIFO);
                for(i = 0; i < timeout; i++)
                {
                        // break if fifo is empty
@@ -1320,6 +1318,8 @@ static void cb_pcidas_interrupt(int irq, void *d, struct pt_regs *regs)
                        }
                }
                async->events |= COMEDI_CB_BLOCK;
+               // clear not-empty interrupt latch
+               outw(devpriv->adc_fifo_bits | INT, devpriv->control_status + INT_ADCFIFO);
        }else if(status & EOAI)
        {
                comedi_error(dev, "bug! encountered end of aquisition interrupt?");
@@ -1373,8 +1373,6 @@ static void handle_ao_interrupt(comedi_device *dev, unsigned int status)
        }
        if(status & DAHFI)
        {
-               // clear half-full interrupt latch
-               outw(devpriv->adc_fifo_bits | DAHFI, devpriv->control_status + INT_ADCFIFO);
                // figure out how many points we are writing to fifo
                num_points = half_fifo;
                if(cmd->stop_src == TRIG_COUNT &&
@@ -1392,6 +1390,8 @@ static void handle_ao_interrupt(comedi_device *dev, unsigned int status)
                // write data to board's fifo
                outsw(devpriv->ao_registers + DACDATA, data, i);
                async->events |= COMEDI_CB_BLOCK;
+               // clear half-full interrupt latch
+               outw(devpriv->adc_fifo_bits | DAHFI, devpriv->control_status + INT_ADCFIFO);
        }
 }
 
index e023d8cec9f8f92ef0e8640093d15cd6cab9935c..3c33628631c377e0166b131528ae58bc5a368349 100644 (file)
@@ -875,11 +875,12 @@ static void das1800_interrupt(int irq, void *d, struct pt_regs *regs)
                comedi_error(dev, "spurious interrupt");
                return;
        }
-       /* clear interrupt */
-       outb(FNE, dev->iobase + DAS1800_STATUS);
 
        das1800_ai_handler(dev, status);
 
+       /* clear interrupt */
+       outb(FNE, dev->iobase + DAS1800_STATUS);
+
        comedi_spin_unlock_irqrestore(&dev->spinlock, flags);
 }