This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

gpiote 2 interrupt handlers for same input pin

I'm upgrading a big project from SDK 6.0 to SDK 12.3, everything's going well, but I had to comment out a library because in SDK 6.0 the previous developer uses the input of a button in 2 different libraries, each with it's own interrupt handler.

When upgrading to SDK 12.3, I changed the interrupt handler register function app_gpiote_register to nrf_drv_gpiote_in_init. But the program would return an error on the second call of this function because the interrupt handler for the Button pin had already been assigned previously. Is there any way to define 2 interrupt handlers for the same pin? Should I not implement it with nrf_drv_gpiote library but app_gpiote instead?

Parents
  • It's been a while since I worked on the nRF5 SDKv12.3. But in general it has not been possible to have two interrupt handler for a specific pin, it may however be that one could register two callback handler that would be called from a common interrupt handler in the background. I think that is the case here also. So in your case I suggest that you in nrf_drv_gpiote_in_init() provide an event handler that will call your two handlers, this should give the same functionality.

    Kenneth

Reply
  • It's been a while since I worked on the nRF5 SDKv12.3. But in general it has not been possible to have two interrupt handler for a specific pin, it may however be that one could register two callback handler that would be called from a common interrupt handler in the background. I think that is the case here also. So in your case I suggest that you in nrf_drv_gpiote_in_init() provide an event handler that will call your two handlers, this should give the same functionality.

    Kenneth

Children
Related