patch from tomasz
authorDavid Schleef <ds@schleef.org>
Wed, 2 Feb 2000 05:16:13 +0000 (05:16 +0000)
committerDavid Schleef <ds@schleef.org>
Wed, 2 Feb 2000 05:16:13 +0000 (05:16 +0000)
lib/timed.c

index 432cb2e06d109310206eea624d0531987318c1e9..d2876ef6ff11e3261c9da2460c0081ace588a9cd 100644 (file)
@@ -55,6 +55,9 @@ int comedi_timed_1chan(comedi_t *dev,unsigned int subd,unsigned int chan,unsigne
        
        /* check range */
 
+       the_range=comedi_get_range(dev,subd,chan,range);
+       maxdata=comedi_get_maxdata(dev,subd,chan);
+
        chan=CR_PACK(chan,range,aref);
 
        t.subdev=subd;
@@ -65,9 +68,6 @@ int comedi_timed_1chan(comedi_t *dev,unsigned int subd,unsigned int chan,unsigne
        comedi_get_timer(dev,subd,freq,&t.trigvar,&act_freq);
        t.trigvar1=1;
        
-       the_range=comedi_get_range(dev,subd,chan,range);
-       maxdata=comedi_get_maxdata(dev,subd,chan);
-       
        buffer=malloc(sizeof(sampl_t)*BUFSZ);
        if(!buffer)return -1;