Hi Muthukumar,
Thank you for contacting DevZone at NordicSemi.
Would you please send me the zip file of your minimal project (including overlays, configurations and main) so that I may flash on the DK and see the issue.
Thanks.
Naeem
Thanks for your reply!
I can see it is getting called every time. I will keep you posted with details, if I observed this issue again.
Added to that, How to enable and disable the interrupt from the code?
After the initialization with the below steps.
I middle of our implementation, i need to enable and disable lot many times.
I can use the below API for enable and disable and it is safe to use in middle of the implementation?
Hi Muthukumar,
Good to know that your project is working.
As you have configured the pin, interrupt, and connected the callbacks. In the code, you can disable the interrupt by using instructions like:
//Disabling the interrupt ret = gpio_pin_interrupt_configure_dt(&ex10_irq_st, GPIO_INT_DISABLE); //Checking if disabled or not if (ret != 0) { printk("Error %d: failed to DISABLE interrupt on %s pin %d\n",ret, button.port->name, button.pin); return; } printk("\r\nINT Disabled\n");
Regarding usage of irq_enable(irqn) and irq_disable(irqn) macros as defined in the Zephyr ISR APIs:
they require irqn, that is irq line number. You can obtain this irqn using DT_IRQN(nid) macro which takes node id and returns the irq number of that node. Use can use DT_NODELABEL(nlabel) to get the node label of nlabel node.
Regards,
Naeem
Thanks Naeem!
This helps.