Module: xenomai-abe
Branch: comedi
Commit: 75b8b49b1e5a3db164a4f3c6649ff14a929c2996
URL:    
http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=75b8b49b1e5a3db164a4f3c6649ff14a929c2996

Author: Alexis Berlemont <alexis.berlem...@gmail.com>
Date:   Sun Sep 27 16:24:15 2009 +0200

Fix internal trigger via instruction (we do not need any data in the
instruction structure)

---

 ksrc/drivers/comedi/instruction.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/ksrc/drivers/comedi/instruction.c 
b/ksrc/drivers/comedi/instruction.c
index 62579c8..67c75d6 100644
--- a/ksrc/drivers/comedi/instruction.c
+++ b/ksrc/drivers/comedi/instruction.c
@@ -80,11 +80,14 @@ int comedi_do_insn_trig(comedi_cxt_t * cxt, comedi_kinsn_t 
* dsc)
 {
        comedi_subd_t *subd;
        comedi_dev_t *dev = comedi_get_dev(cxt);
+       lsampl_t trignum;
 
        /* Basic checkings */
-       if (dsc->data_size != 1)
+       if (dsc->data_size > 1)
                return -EINVAL;
-
+       
+       trignum = (dsc->data_size == 1) ? dsc->data[0] : 0;
+       
        if (dsc->idx_subd >= dev->transfer.nb_subd)
                return -EINVAL;
 
@@ -95,7 +98,7 @@ int comedi_do_insn_trig(comedi_cxt_t * cxt, comedi_kinsn_t * 
dsc)
                return -EINVAL;
 
        /* Performs the trigger */
-       return subd->trigger(subd, dsc->data[0]);
+       return subd->trigger(subd, trignum);
 }
 
 int comedi_fill_insndsc(comedi_cxt_t * cxt, comedi_kinsn_t * dsc, void *arg)


_______________________________________________
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git

Reply via email to