fixed bug where pulsewidth meas. armed incorrectly
authorTim Ousley <tim.ousley@ni.com>
Wed, 2 May 2001 21:50:46 +0000 (21:50 +0000)
committerTim Ousley <tim.ousley@ni.com>
Wed, 2 May 2001 21:50:46 +0000 (21:50 +0000)
comedi/drivers/ni_mio_common.c

index d86d63c845dd75e0374feafccbe134ab46a964ed..839083b1f055aa98174ac66107a213f6ab0af124 100644 (file)
@@ -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;
        }
 }