fix problems with set_target setting the target to NaN on unipolar ao ranges
authorFrank Mori Hess <fmhess@speakeasy.net>
Thu, 12 Jun 2003 19:57:43 +0000 (19:57 +0000)
committerFrank Mori Hess <fmhess@speakeasy.net>
Thu, 12 Jun 2003 19:57:43 +0000 (19:57 +0000)
comedi_calibrate/comedi_calibrate.c

index a146bbea47bbf7338ebe899ae709c77f97ef55f8..90b80e6697a23da50cdf2cff4de37618cf5c9e3b 100644 (file)
@@ -318,6 +318,8 @@ void set_target( calibration_setup_t *setup, int obs,double target)
        comedi_range *range;
        lsampl_t maxdata, data;
 
+       comedi_set_global_oor_behavior( COMEDI_OOR_NUMBER );
+
        range = comedi_get_range(setup->dev,
                setup->observables[obs].preobserve_insn.subdev,
                CR_CHAN( setup->observables[obs].preobserve_insn.chanspec ),
@@ -426,6 +428,7 @@ void measure_observable( calibration_setup_t *setup, int obs)
 
        sci_sprint_alt(s,sv.average,sv.error);
        DPRINT(0,"reading %s, target %g\n",s, setup->observables[obs].target);
+       assert( isnan( setup->observables[obs].target) == 0 );
 }
 
 void observable_dependence(calibration_setup_t *setup, int obs)