converted to use comedi_buf_put()
authorFrank Mori Hess <fmhess@speakeasy.net>
Fri, 5 Jul 2002 20:10:40 +0000 (20:10 +0000)
committerFrank Mori Hess <fmhess@speakeasy.net>
Fri, 5 Jul 2002 20:10:40 +0000 (20:10 +0000)
comedi/drivers/das6402.c

index e61796c2560aa3355f164296fb02065ad29bc537..855c5a95d591990f03bda79dcadbc5df5f5a6022 100644 (file)
@@ -198,38 +198,13 @@ static void das6402_ai_fifo_read(comedi_device *dev,sampl_t *data,int n)
 #endif
 
 
-/*
- *  I know that this looks like terribly complicated code for doing
- *  such a simple task, but it is fast.
- */
 static void das6402_ai_fifo_dregs(comedi_device *dev,comedi_subdevice *s)
 {
-       int n,i;
-       sampl_t *data;
-
        while(1){
-               data=s->async->data+s->async->buf_int_ptr;
-               n=(s->async->data_len-s->async->buf_int_ptr)/sizeof(sampl_t);
-               for(i=0;i<n;i++){
-                       if(!(inb(dev->iobase+8)&0x01))
-                               return;
-                       *data=inw(dev->iobase);
-                       data++;
-                       s->async->buf_int_ptr+=sizeof(sampl_t);
-                       s->async->buf_int_count+=sizeof(sampl_t);
-               }
-               s->async->buf_int_ptr=0;
-               s->async->events |= COMEDI_CB_EOBUF;
+               if(!(inb(dev->iobase+8)&0x01))
+                       return;
+               comedi_buf_put( s->async, inw(dev->iobase) );
        }
-#if 0
-       if (n>1024) {
-               printk("das6402: Someting is very wrong with the card fifo!\n");
-               /*
-                *  Not really...  Additional samples might be placed into the
-                *  fifo after the interrupt, but before the last one is read.
-                */
-       }
-#endif
 }
 
 static int das6402_ai_cancel(comedi_device *dev,comedi_subdevice *s)