ignore ai errors that occur after we have all the data we wanted
authorFrank Mori Hess <fmhess@speakeasy.net>
Fri, 5 Sep 2003 17:14:52 +0000 (17:14 +0000)
committerFrank Mori Hess <fmhess@speakeasy.net>
Fri, 5 Sep 2003 17:14:52 +0000 (17:14 +0000)
comedi/drivers/dt282x.c

index 746532e556bc4c9d7ae3e72fe3b954feed58bca1..41086868e63e4e592153b3f513838afcfcf86802 100644 (file)
@@ -559,12 +559,6 @@ static irqreturn_t dt282x_interrupt(int irq, void *d, struct pt_regs *regs)
        int handled = 0;
 
        adcsr=inw(dev->iobase + DT2821_ADCSR);
-       if (adcsr & DT2821_ADERR) {
-               comedi_error(dev, "A/D error");
-               dt282x_ai_cancel(dev,s);
-               s->async->events |= COMEDI_CB_ERROR;
-               handled = 1;
-       }
        supcsr = inw(dev->iobase + DT2821_SUPCSR);
        /*printk("supcsr=%02x\n",supcsr);*/
        if (supcsr & DT2821_DMAD) {
@@ -574,6 +568,15 @@ static irqreturn_t dt282x_interrupt(int irq, void *d, struct pt_regs *regs)
                        dt282x_ao_dma_interrupt(dev);
                handled = 1;
        }
+       if (adcsr & DT2821_ADERR) {
+               if(devpriv->nread != 0 )
+               {
+                       comedi_error(dev, "A/D error");
+                       dt282x_ai_cancel(dev,s);
+                       s->async->events |= COMEDI_CB_ERROR;
+               }
+               handled = 1;
+       }
        if ((dacsr = inw(dev->iobase + DT2821_DACSR)) & DT2821_DAERR) {
 #if 0
                static int warn = 5;