From 11264f9d0163159a4acf1afe4f2494eccc819c06 Mon Sep 17 00:00:00 2001 From: Frank Mori Hess Date: Sat, 14 Jun 2003 16:04:23 +0000 Subject: [PATCH] make unipolar gain calibration work a little better --- comedi_calibrate/cal_common.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/comedi_calibrate/cal_common.c b/comedi_calibrate/cal_common.c index 18739c3..7f044fd 100644 --- a/comedi_calibrate/cal_common.c +++ b/comedi_calibrate/cal_common.c @@ -157,6 +157,15 @@ static void generic_do_dac_channel( calibration_setup_t *setup, const generic_la static void generic_do_adc_channel( calibration_setup_t *setup, const generic_layout_t *layout, comedi_calibration_setting_t *current_cal, unsigned int channel, unsigned int range ) { + /* make sure unipolar ground observable isn't out-of-range before + * doing gain calibrations */ + if( is_unipolar( setup->dev, setup->ad_subdev, channel, range ) ) + { + generic_do_cal( setup, current_cal, layout->adc_ground_observable( setup, channel, range ), + layout->adc_offset( channel ) ); + generic_do_cal( setup, current_cal, layout->adc_ground_observable( setup, channel, range ), + layout->adc_offset_fine( channel ) ); + } generic_do_relative( setup, current_cal, layout->adc_high_observable( setup, channel, range ), layout->adc_ground_observable( setup, channel, range ), layout->adc_gain( channel ) ); generic_do_cal( setup, current_cal, layout->adc_ground_observable( setup, channel, range ), -- 2.26.2