tweak to make rt_task clean itself up without one scan delay
authorFrank Mori Hess <fmhess@speakeasy.net>
Thu, 7 Jun 2001 17:52:22 +0000 (17:52 +0000)
committerFrank Mori Hess <fmhess@speakeasy.net>
Thu, 7 Jun 2001 17:52:22 +0000 (17:52 +0000)
comedi/drivers/comedi_rt_timer.c

index 982f2f75998c0c400c124cc99b2f592bedbd7b87..ccb316b42f4676ced5a68f7b13cfa07f3eec8929 100644 (file)
@@ -322,6 +322,8 @@ cleanup:
 static void timer_task_func(int d)
 {
        comedi_device *dev=(comedi_device *)d;
+       comedi_subdevice *s = dev->subdevices + 0;
+       comedi_cmd *cmd=&s->async->cmd;
        int ret;
        unsigned long long n;
 
@@ -331,7 +333,7 @@ static void timer_task_func(int d)
                devpriv->scan_task_active = 1;
                devpriv->start = rt_get_time();
 
-               for(n = 0; 1; n++){
+               for(n = 0; n < cmd->stop_arg || cmd->stop_src == TRIG_NONE; n++){
                        // scan timing
                        if(n)
                                rt_task_wait_period();