- From: Ian Abbott <abbotti_at_mev.co.uk>
- Date: Tue, 21 Aug 2007 11:13:59 +0100
On 20/08/07 14:39, Gergely Imreh wrote: > Ok, my bad.... > > It seems, that the AO subdevice has to have the SDF_CMD_WRITE flag to > be able to set a command... > And it looks the async can be set only when there's already a command > sent by the user... If I try to set it in the attach function, it > doesn't work. async is allocated after the attach function returns, see postconfig() in comedi/drivers.c. > Is it really so? Is there a way to handle, if a user tries to set of > an INSN_INTTRIG before any command has been set? There is enough protection in parse_insn() in comedi/comedi_fops.c to stop an INSN_INTTRIG running non-existant code. You can set s->async->inttrig in your s->do_cmd function. It can be made fairly dynamic, according on the phase of the command. For example, if INT_TRIG is used as a start_src and s->async->inttrig starts off pointing to a "start_acquisition" function, the "start_acquisition" function could set s->async->inttrig to something else, usually a null pointer, but it could point it to a "begin_scan" function for example (if scan_begin_src is also INT_TRIG). (This example is fairly pointless, as you'd have to send an INSN_INTTRIG twice to start the first scan, once to start the acquisition and once to start the scan.) -- -=( Ian Abbott _at_ MEV Ltd. E-mail: <abbotti_at_mev.co.uk> )=- -=( Tel: +44 (0)161 477 1898 FAX: +44 (0)161 718 3587 )=-
Received on 2007-08-21Z09:13:59