made ao_waveform use same parse_options() as other demos
authorFrank Mori Hess <fmhess@speakeasy.net>
Wed, 27 Jun 2001 19:51:11 +0000 (19:51 +0000)
committerFrank Mori Hess <fmhess@speakeasy.net>
Wed, 27 Jun 2001 19:51:11 +0000 (19:51 +0000)
demo/ao_waveform.c

index d0ef7f865f1273d1d85aea58934832d25d33487a..efaa785c0314bab069b68eb2ab31a92dabea5819 100644 (file)
@@ -90,7 +90,6 @@ void dds_init_sawtooth(void);
 
 int main(int argc, char *argv[])
 {
-       char *fn = NULL;
        comedi_cmd cmd;
        int err;
        int n,m;
@@ -98,13 +97,13 @@ int main(int argc, char *argv[])
        comedi_t *dev;
        unsigned int chanlist[1];
 
-       if(argc>=2){
-               waveform_frequency=strtod(argv[1],NULL);
-       }
+       parse_options(argc,argv);
 
-       fn = "/dev/comedi0";
+       if(value){
+               waveform_frequency = value;
+       }
 
-       dev = comedi_open(fn);
+       dev = comedi_open(filename);
 
        subdevice = comedi_find_subdevice_by_type(dev,COMEDI_SUBD_AO,0);