From: David Schleef Date: Wed, 25 Sep 2002 01:11:47 +0000 (+0000) Subject: add some error checking X-Git-Tag: r0_7_21~305 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=5dae30af2fc097b5b18334c9de38d07354134a60;p=comedilib.git add some error checking --- 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);