Hi all,
I'm working on GPIO module, Vybrid Tower Board (MQX OS). I want to install 2 interrupts (falling/rising) on GPIO input switch BSP_SW1. So how to register 2 interrupt service routine on this gpio?
Thanks!
解決済! 解決策の投稿を見る。
Hi,
Let me see if I understand correctly. You want to install 2 different callbacks, one for rising and other for falling edge pro the BSP_SW1, right?
So far the the MQX API only supports one callback. I would do it in the next way:
1.- Install one general callback that is generated for rising and falling edge.
2.- In that callback check the state of the pin and execute one routine or other depending on the state of the pin.
You have to keep in mind that there is one interrupt vector per PORT. Therefore you have to implement a more complex handler if you want to detect the pin that caused the interrupt.
Best Regards,
Alejandro
Hi,
Let me see if I understand correctly. You want to install 2 different callbacks, one for rising and other for falling edge pro the BSP_SW1, right?
So far the the MQX API only supports one callback. I would do it in the next way:
1.- Install one general callback that is generated for rising and falling edge.
2.- In that callback check the state of the pin and execute one routine or other depending on the state of the pin.
You have to keep in mind that there is one interrupt vector per PORT. Therefore you have to implement a more complex handler if you want to detect the pin that caused the interrupt.
Best Regards,
Alejandro
Thank Alejandro Lozano. Your answer is good.