Now,I use kernal-2.6.35 with xenomai Patch and register a gpio(gpio2-14) interrupt,but when running the kernal i find it always lose some response.
The time is interrupted every 500us ,some times it will lose three consecutive. I don"t know why .The code:
#define MY_GPIO2_14 (1*32+14)
int irq = gpio_to_irq( MY_GPIO2_14);
.....................
.............................
int irq_handle_function(int irq, void *device_id)
{
disable_irq(irq);
if(phase==PH_RUNNING)
ctrl_mnm1221_m();
enable_irq(irq);
return IRQ_HANDLED;
}
......................................
.........................................
....................................
mxc_iomux_v3_setup_pad( MX53_PAD_PATA_DATA14__GPIO2_14 );
ret = gpio_request(MY_GPIO2_14, "RTEX" );
if( ret < 0 )
{
printk( KERN_ALERT"can not get irq,error!\n" );
}
gpio_direction_input( MY_GPIO2_14);
printk( KERN_ALERT"imxint_irq = %d\n", irq );
ret = request_irq( irq, irq_handle_function, IRQF_TRIGGER_LOW , "imx-int", NULL );
if( ret )
{
printk( KERN_ALERT"IRQ request failed!\n" );
gpio_free( MY_GPIO2_14 );
return ret;
}
gpio_free( MY_GPIO2_14 );
Is somewhere wrong ? Should I set the priorities of interruption? It need strong real-time requirements. Thanks
did your ever set the irq type? falling edge or rising edge?