Forum Discussion
Altera_Forum
Honored Contributor
12 years agoHi,
--- Quote Start --- Following is my interrupt handler: static irqreturn_t gpio_irq_handler(int irq, void *dev_id) { int ipending = __builtin_rdctl(4); if((ipending & 0x03) > 0) { *(base_addr + 3) = 0;//Clear the Edge Capture do_gettimeofday(&tv); time_to_tm(tv.tv_sec, 0, &broken); printk ("%02d:%02d:%02d:%03ld\n",broken.tm_hour, broken.tm_min, broken.tm_sec, (tv.tv_usec/1000)); /////////////////////////////////////////////////////////////////////////////// } return IRQ_HANDLED; } --- Quote End --- Did you take account of the execution time of 'printk' ? Please consider what will happen if it will take over 100msec. And you don't need to check 'ipending', because the kernel checks it and calls this handler. But it's better for you to check whether the edge is really captured or not. Kazu