From: Frank Mori Hess Date: Tue, 16 Sep 2003 00:30:13 +0000 (+0000) Subject: added munging to kcomedilib X-Git-Tag: r0_7_69~214 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=b8d7049d29dc0ce51f36665ddfa4fd7799ace5b5;p=comedi.git added munging to kcomedilib --- diff --git a/comedi/kcomedilib/get.c b/comedi/kcomedilib/get.c index 3146b5b2..2290c33f 100644 --- a/comedi/kcomedilib/get.c +++ b/comedi/kcomedilib/get.c @@ -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; } /*