From 9ce4b51aaf67bfe97927ed9c097ddc3c9da3e0eb Mon Sep 17 00:00:00 2001 From: Frank Mori Hess Date: Fri, 4 May 2001 22:19:33 +0000 Subject: [PATCH] bug fixes, seems to work --- comedi/drivers/comedi_rt_timer.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/comedi/drivers/comedi_rt_timer.c b/comedi/drivers/comedi_rt_timer.c index 53bcdf11..ada553e4 100644 --- a/comedi/drivers/comedi_rt_timer.c +++ b/comedi/drivers/comedi_rt_timer.c @@ -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; -- 2.26.2