From: Frank Mori Hess Date: Wed, 17 Jul 2002 21:55:33 +0000 (+0000) Subject: added error handling for failed writes to buffer X-Git-Tag: r0_7_66~142 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=48d6d33296077f1e7e22e354fa54fe7771635507;p=comedi.git added error handling for failed writes to buffer --- diff --git a/comedi/drivers/comedi_fc.c b/comedi/drivers/comedi_fc.c index e3e964b6..d45a77aa 100644 --- a/comedi/drivers/comedi_fc.c +++ b/comedi/drivers/comedi_fc.c @@ -102,6 +102,21 @@ unsigned int cfc_read_array_from_buffer( comedi_subdevice *subd, void *data, return num_bytes; } +unsigned int cfc_handle_events( comedi_device *dev, comedi_subdevice *subd ) +{ + unsigned int events = subd->async->events; + + if( events & COMEDI_CB_ERROR ) + events |= COMEDI_CB_EOA; + + if( events & COMEDI_CB_EOA ) + subd->cancel( dev, subd ); + + comedi_event( dev, subd, events ); + + return events; +} + MODULE_AUTHOR("Frank Mori Hess "); MODULE_DESCRIPTION("Shared functoins for Comedi low-level drivers"); MODULE_LICENSE("GPL"); diff --git a/comedi/drivers/comedi_fc.h b/comedi/drivers/comedi_fc.h index 5e49c7ca..46ed5ee2 100644 --- a/comedi/drivers/comedi_fc.h +++ b/comedi/drivers/comedi_fc.h @@ -44,3 +44,5 @@ inline unsigned int cfc_write_long_to_buffer( comedi_subdevice *subd, lsampl_t d unsigned int cfc_read_array_from_buffer( comedi_subdevice *subd, void *data, unsigned int num_bytes ); + +unsigned int cfc_handle_events( comedi_device *dev, comedi_subdevice *subd );