demo/mmap: use comedi_get_cmd_generic_timed()
Use local function prepare_cmd_lib() -- which uses comedi_get_cmd_generic_timed() -- to prepare a good command for the device. Bail out early if it fails.
This commit is contained in:
parent
1e8ca17ba9
commit
ad70295bb4
1 changed files with 8 additions and 2 deletions
10
demo/mmap.c
10
demo/mmap.c
|
@ -110,8 +110,14 @@ int main(int argc, char *argv[])
|
|||
chanlist[i] = CR_PACK(options.channel + i, options.range, options.aref);
|
||||
}
|
||||
|
||||
//prepare_cmd_lib(dev, options.subdevice, options.n_scan, options.n_chan, 1e9 / options.freq, cmd);
|
||||
prepare_cmd(dev, options.subdevice, options.n_scan, options.n_chan, 1e9 / options.freq, cmd);
|
||||
/* prepare_cmd_lib() uses a Comedilib routine to find a
|
||||
* good command for the device. prepare_cmd() explicitly
|
||||
* creates a command, which may not work for your device. */
|
||||
ret = prepare_cmd_lib(dev, options.subdevice, options.n_scan, options.n_chan, 1e9 / options.freq, cmd);
|
||||
//prepare_cmd(dev, options.subdevice, options.n_scan, options.n_chan, 1e9 / options.freq, cmd);
|
||||
if(ret < 0){
|
||||
exit(1);
|
||||
}
|
||||
|
||||
ret = comedi_command_test(dev, cmd);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue