bug fixes, seems to work
authorFrank Mori Hess <fmhess@speakeasy.net>
Fri, 4 May 2001 22:19:33 +0000 (22:19 +0000)
committerFrank Mori Hess <fmhess@speakeasy.net>
Fri, 4 May 2001 22:19:33 +0000 (22:19 +0000)
comedi/drivers/comedi_rt_timer.c

index 53bcdf116d5fc56262acbb933c928c5601488a6b..ada553e4726ee8febc98f52ea9b4b4633191ae04 100644 (file)
@@ -238,17 +238,12 @@ static int timer_cmd(comedi_device *dev,comedi_subdevice *s)
        ts.tv_nsec=cmd->scan_begin_arg;
 
 #ifdef CONFIG_COMEDI_RTL
-       // XXX timespec_to_RTIME() is undeclared (and undefined?) compiling against rtl3.0 - FMH
-       period=timespec_to_RTIME(ts);
+       period=HRT_TO_8254(cmd->scan_begin_arg);
        rt_task_init(&devpriv->rt_task,timer_ai_task_func,(int)dev,3000,4);
 #endif
 #ifdef CONFIG_COMEDI_RTAI
        period = start_rt_timer(nano2count(cmd->scan_begin_arg));
-       // XXX line repeated a few lines down? - FMH
-       now = rt_get_time();
        rt_task_init(&devpriv->rt_task,timer_ai_task_func,(int)dev,3000,0,0,0);
-       // XXX line repeated a few lines down? - FMH
-       rt_task_make_periodic(&devpriv->rt_task,now+period,period);
 #endif
 
        now=rt_get_time();
@@ -272,6 +267,7 @@ static int timer_attach(comedi_device *dev,comedi_devconfig *it)
        comedi_subdevice *s;
 
        printk("comedi%d: timer: ",dev->minor);
+
        dev->board_name="timer";
 
        dev->n_subdevices=1;
@@ -283,10 +279,13 @@ static int timer_attach(comedi_device *dev,comedi_devconfig *it)
        devpriv->device=it->options[0];
        devpriv->subd=it->options[1];
 
+       printk("device %d, subdevice %d\n", devpriv->device, devpriv->subd);
+
        devpriv->dev=comedi_get_device_by_minor(devpriv->device);
        devpriv->s=devpriv->dev->subdevices+devpriv->subd;
 
        s=dev->subdevices+0;
+       dev->read_subdev = s;
        s->type=COMEDI_SUBD_AI;
        s->subdev_flags=SDF_READABLE;
        s->n_chan=devpriv->s->n_chan;