fixed clearing of async->events
authorFrank Mori Hess <fmhess@speakeasy.net>
Thu, 10 May 2001 16:47:33 +0000 (16:47 +0000)
committerFrank Mori Hess <fmhess@speakeasy.net>
Thu, 10 May 2001 16:47:33 +0000 (16:47 +0000)
comedi/drivers/comedi_rt_timer.c

index 0256d577631d712302f468c23f27fc1655b507ee..63ef5b55de4a43beaf58883ca7dc2a677dddc848 100644 (file)
@@ -141,6 +141,7 @@ static void timer_ai_task_func(int d)
                }
                s->async->events |= COMEDI_CB_EOS;
                comedi_event(dev,s,s->async->events);
+               s->async->events = 0;
 #ifdef CONFIG_COMEDI_RTL
                rt_task_wait();
 #endif
@@ -150,6 +151,7 @@ static void timer_ai_task_func(int d)
        }
        s->async->events |= COMEDI_CB_EOA;
        comedi_event(dev,s,s->async->events);
+       s->async->events = 0;
 #ifdef CONFIG_COMEDI_RTL
        rtl_global_pend_irq(devpriv->soft_irq);
 #endif
@@ -192,6 +194,7 @@ static void timer_ao_task_func(int d)
                        }
                        s->async->events |= COMEDI_CB_EOS;
                        comedi_event(dev,s,s->async->events);
+                       s->async->events = 0;
 #ifdef CONFIG_COMEDI_RTL
                        rt_task_wait();
 #endif
@@ -202,6 +205,7 @@ static void timer_ao_task_func(int d)
        }while(ao_repeat_flag);
        s->async->events |= COMEDI_CB_EOA;
        comedi_event(dev,s,s->async->events);
+       s->async->events = 0;
 #ifdef CONFIG_COMEDI_RTL
        rtl_global_pend_irq(devpriv->soft_irq);
 #endif
@@ -303,6 +307,8 @@ static int timer_cmd(comedi_device *dev,comedi_subdevice *s)
        struct timespec ts;
        comedi_cmd *cmd = &s->async->cmd;
 
+       s->async->events = 0;
+
        /* hack attack: drivers are not supposed to do this: */
        dev->rt = 1;