#define rt_request_srq(x,y,z) rtl_get_soft_irq(y,"timer")
#define rt_task_init(a,b,c,d,e,f,g) rt_task_init(a,b,c,d,(e)+1)
#define rt_task_resume(x) rt_task_wakeup(x)
+#define rt_set_oneshot_mode()
#endif
#ifdef CONFIG_COMEDI_RTAI
volatile int stop; // indicates we should stop
volatile int rt_task_active; // indicates rt_task is servicing a comedi_cmd
volatile int scan_task_active; // indicates scan_task is servicing a comedi_cmd
+ unsigned timer_running : 1;
}timer_private;
#define devpriv ((timer_private *)dev->private)
comedi_cmd *cmd = &async->cmd;
RTIME now, delay, period;
int ret;
-
+
devpriv->stop = 0;
s->async->events = 0;
comedi_error(dev, "error starting rt_task");
return ret;
}
-
return 0;
}
devpriv->device = comedi_open(path);
devpriv->subd=it->options[1];
- printk("device %p, subdevice %d\n", devpriv->device, devpriv->subd);
+ printk("emulating commands for minor %i, subdevice %d\n", it->options[0], devpriv->subd);
- emul_dev = (comedi_device *)devpriv->device;
+ emul_dev = devpriv->device;
emul_s = emul_dev->subdevices+devpriv->subd;
// input or output subdevice
return -EINVAL;
}
-#ifdef CONFIG_COMEDI_RTAI
rt_set_oneshot_mode();
-#endif
+ start_rt_timer( 1 );
+ devpriv->timer_running = 1;
devpriv->rt_task = kmalloc(sizeof(RT_TASK),GFP_KERNEL);
memset(devpriv->rt_task,0,sizeof(RT_TASK));
rt_task_delete(devpriv->scan_task);
kfree(devpriv->scan_task);
}
+ if( devpriv->timer_running )
+ stop_rt_timer();
}
return 0;