From: Tim Ousley Date: Wed, 2 May 2001 21:50:46 +0000 (+0000) Subject: fixed bug where pulsewidth meas. armed incorrectly X-Git-Tag: r0_7_59~80 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=b362c2e1d5ae733c24b7f085174d3e5a46787470;p=comedi.git fixed bug where pulsewidth meas. armed incorrectly --- diff --git a/comedi/drivers/ni_mio_common.c b/comedi/drivers/ni_mio_common.c index d86d63c8..839083b1 100644 --- a/comedi/drivers/ni_mio_common.c +++ b/comedi/drivers/ni_mio_common.c @@ -2222,12 +2222,13 @@ int GPCT_Arm(comedi_device *dev, int chan){ g_status=win_in(G_Status_Register); if(chan == 0){ - if(G0_Counting_St & g_status) { + //TIM 5/2/01 possible error with very short pulses + if((G0_Counting_St & g_status)|| !(G0_Armed_St&g_status)) { //error: we missed the beginning of the pulse return -EINVAL; //there is probably a more accurate error code... } }else{ - if(G1_Counting_St & g_status) { + if((G1_Counting_St & g_status)|| !(G1_Armed_St&g_status)) { //error: we missed the beginning of the pulse return -EINVAL; } @@ -2649,7 +2650,11 @@ static int ni_gpct_insn_config(comedi_device *dev,comedi_subdevice *s, if(retval==0){ return insn->n; }else{ - printk("error: retval was %d\n",retval); + if(data[0]!=GPCT_ARM){ + printk("error: retval was %d\n",retval); + printk("data[0] is 0x%08x, data[1] is 0x%08x\n",data[0],data[1]); + } + return retval; } }