added error handling for failed writes to buffer
authorFrank Mori Hess <fmhess@speakeasy.net>
Wed, 17 Jul 2002 21:55:33 +0000 (21:55 +0000)
committerFrank Mori Hess <fmhess@speakeasy.net>
Wed, 17 Jul 2002 21:55:33 +0000 (21:55 +0000)
comedi/drivers/comedi_fc.c
comedi/drivers/comedi_fc.h

index e3e964b645ed63bceabdc3eecd94ff359ffe57cd..d45a77aa76c9ed54778fabf4ff8a99f62230cee7 100644 (file)
@@ -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 <fmhess@users.sourceforge.net>");
 MODULE_DESCRIPTION("Shared functoins for Comedi low-level drivers");
 MODULE_LICENSE("GPL");
index 5e49c7caf750e39c83a264cd774c11babf51a621..46ed5ee2b91b21319ead67c9287518a347645e17 100644 (file)
@@ -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 );