IRQ Handling Best Practices

DrMickeyLauer
Posts: 168
Joined: Sun May 22, 2022 2:42 pm

IRQ Handling Best Practices

Postby DrMickeyLauer » Fri Mar 15, 2024 11:50 pm

While I understand the difference of gpio_isr_register (handle all GPIO IRQs on a fixed core with your own logic) and gpio_install_isr_service (install broker on fixed core) + gpio_isr_handler_add (register one GPIO IRQ with global broker), I'm seriously missing a middle ground between those two approaches.

My application is composed of a few subsystems where IRQ handling is critical (W5500, MCP2518fd) and several subsystems where IRQ handling is uncritical (buttons, seldomly read sensors), and possibly some more "in between".

How am I supposed to map my ISRs to different IRQ levels and different IRQ flags when all I have available are such broad swords?

Do I really need to decide the IRQ flags for _all_ of my ISRs together? And is there no chance of handling some IRQs on one core and some on another?

Or should I just gpio_install_isr_service(0) like all others and carry on? Do the flags really make much a difference?

ESP_Sprite
Posts: 9730
Joined: Thu Nov 26, 2015 4:08 am

Re: IRQ Handling Best Practices

Postby ESP_Sprite » Sat Mar 16, 2024 5:49 am

The GPIO subsystem only has one interrupt available (well, technically two on some chips, but I'm not sure if software supports using them both), so whatever option you pick goes for all GPIOs.

Who is online

Users browsing this forum: moeen_sa and 95 guests