added munging to kcomedilib
authorFrank Mori Hess <fmhess@speakeasy.net>
Tue, 16 Sep 2003 00:30:13 +0000 (00:30 +0000)
committerFrank Mori Hess <fmhess@speakeasy.net>
Tue, 16 Sep 2003 00:30:13 +0000 (00:30 +0000)
comedi/kcomedilib/get.c

index 3146b5b28de938ff969a80a50652e463e9d6d960..2290c33fe6e11af656fed1eadc543f2fcdc3369d 100644 (file)
@@ -186,12 +186,14 @@ int comedi_get_buffer_contents( comedi_t *d, unsigned int subdevice )
        comedi_device *dev = (comedi_device *)d;
        comedi_subdevice *s = dev->subdevices + subdevice;
        comedi_async *async;
+       unsigned int num_bytes;
 
        if( subdevice >= dev->n_subdevices ) return -1;
        async = s->async;
-       if(async == NULL) return 0;
 
-       return async->buf_write_count - async->buf_read_count;
+       num_bytes = comedi_buf_read_n_available(s);
+       comedi_buf_munge( dev, s, async->buf_write_count - async->munge_count );
+       return num_bytes;
 }
 
 /*