From: Frank Mori Hess Date: Mon, 2 Aug 2004 00:09:51 +0000 (+0000) Subject: fix check for presence of ao subdevice X-Git-Tag: r0_7_22~16 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=06a7891c4dd4975f9d2edfe19babbf2efeb253bc;p=comedilib.git fix check for presence of ao subdevice --- diff --git a/comedi_calibrate/cal_common.c b/comedi_calibrate/cal_common.c index 7f99c7a..5729396 100644 --- a/comedi_calibrate/cal_common.c +++ b/comedi_calibrate/cal_common.c @@ -284,7 +284,7 @@ int generic_cal_by_channel_and_range( calibration_setup_t *setup, num_ai_channels = comedi_get_n_channels( setup->dev, setup->ad_subdev ); if( num_ai_channels < 0 ) return -1; - if( setup->da_subdev && setup->do_output ) + if(setup->da_subdev >= 0 && setup->do_output ) { assert( comedi_range_is_chan_specific( setup->dev, setup->da_subdev ) == 0 ); @@ -363,7 +363,7 @@ int generic_cal_by_range( calibration_setup_t *setup, num_ai_ranges = comedi_get_n_ranges( setup->dev, setup->ad_subdev, 0 ); if( num_ai_ranges < 0 ) return -1; - if( setup->da_subdev && setup->do_output ) + if(setup->da_subdev >= 0 && setup->do_output ) { assert( comedi_range_is_chan_specific( setup->dev, setup->da_subdev ) == 0 ); @@ -432,7 +432,7 @@ int generic_cal_ao(calibration_setup_t *setup, comedi_calibration_setting_t *current_cal; - if(setup->da_subdev && setup->do_output) + if(setup->da_subdev >= 0 && setup->do_output) { assert( comedi_range_is_chan_specific( setup->dev, setup->da_subdev ) == 0 );