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) {
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;