From 5dae30af2fc097b5b18334c9de38d07354134a60 Mon Sep 17 00:00:00 2001 From: David Schleef Date: Wed, 25 Sep 2002 01:11:47 +0000 Subject: [PATCH] add some error checking --- demo/ao_waveform.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/demo/ao_waveform.c b/demo/ao_waveform.c index b78db77..364d762 100644 --- a/demo/ao_waveform.c +++ b/demo/ao_waveform.c @@ -117,7 +117,7 @@ int main(int argc, char *argv[]) parse_options(argc,argv); /* Force n_chan to be 1 */ - n_chan = 2; + n_chan = 1; if(value){ waveform_frequency = value; @@ -163,6 +163,18 @@ int main(int argc, char *argv[]) dump_cmd(stdout,&cmd); + err = comedi_command_test(dev, &cmd); + if (err < 0) { + comedi_perror("comedi_command_test"); + exit(1); + } + + err = comedi_command_test(dev, &cmd); + if (err < 0) { + comedi_perror("comedi_command_test"); + exit(1); + } + if ((err = comedi_command(dev, &cmd)) < 0) { comedi_perror("comedi_command"); exit(1); -- 2.26.2