From ef7497ab76ddb44459bf34b364acea7715d77bd6 Mon Sep 17 00:00:00 2001 From: Frank Mori Hess Date: Thu, 5 Jul 2001 15:55:09 +0000 Subject: [PATCH] fix for trig emulation by cmd --- comedi/trig.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/comedi/trig.c b/comedi/trig.c index 5781ca1b..50421bc0 100644 --- a/comedi/trig.c +++ b/comedi/trig.c @@ -258,10 +258,19 @@ int command_trig(comedi_device *dev,comedi_subdevice *s,comedi_trig *it) if(ret)return ret; ret=s->do_cmdtest(dev,s,&async->cmd); - if(ret)return -EINVAL; + // let it fix up arguments if necessary + if(ret == 3) + ret=s->do_cmdtest(dev,s,&async->cmd); + if(ret == 4) + ret=s->do_cmdtest(dev,s,&async->cmd); + if(ret) + return -EINVAL; ret=s->do_cmd(dev,s); - if(ret>0)return -EINVAL; + if(ret)return -EINVAL; + + // XXX write back changes to trig struct? + return ret; } @@ -285,7 +294,7 @@ int mode_to_command(comedi_cmd *cmd,comedi_trig *it) cmd->scan_end_arg=it->n_chan; cmd->stop_src=TRIG_COUNT; cmd->stop_arg=it->n; - + break; case 2: cmd->scan_begin_src=TRIG_TIMER; -- 2.26.2