Processing multiple interrupts sources
Posted: Thu Mar 16, 2017 10:13 pm
Hi, I'm looking at this code: http://www.lucadentella.it/en/2017/02/2 ... interrupts
What this code does: 1 interrupt source --> 1 ISR handler --> 1 semaphore --> 1 loop processing events delivered via xSemaphoreTake().
But I need to handle a multiple interrupts sources.
If I pass individual ID's as arg to gpio_isr_handler_add(), I can handle multiple interrupt sources and I still only need 1 ISR handler. This is great! But how am I supposed to forward the individual ID's through the semaphore mechanism? Do I need to use a list of semaphores, 1 per event source? Oh no. And then I also need to code and run a dedicated loop for each semaphore?? That can't be right. Hopefully someone can point me in a better direction. Thank you.
What this code does: 1 interrupt source --> 1 ISR handler --> 1 semaphore --> 1 loop processing events delivered via xSemaphoreTake().
But I need to handle a multiple interrupts sources.
If I pass individual ID's as arg to gpio_isr_handler_add(), I can handle multiple interrupt sources and I still only need 1 ISR handler. This is great! But how am I supposed to forward the individual ID's through the semaphore mechanism? Do I need to use a list of semaphores, 1 per event source? Oh no. And then I also need to code and run a dedicated loop for each semaphore?? That can't be right. Hopefully someone can point me in a better direction. Thank you.