This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Hardcoded IRQ priority on GPIOTE library

Hi, I'm using the GPIOTE library to detect an interrupt from a sensor, query the sensor and update the gatts value. The problem I've found is that the IRQ priority is hardcoded on app_gpiote_init to APP_IRQ_PRIORITY_HIGH so this prevents me to use the event handler to directly update the gatts value, just because the interrupt priority level is higher than the SVC. A workaround is to queue an event to the scheduler, but I think it's an unnecessary overhead.

So my question is, there's any reason for hardcoding the IRQ priority to high? As I can see nrf_drv_gpiote uses the GPIOTE_CONFIG_IRQ_PRIORITY macro defined on nrf_drv_config.h instead, which IMHO is a better solution.

As a side note, I'm using the NRF52 SDK, but it is the same on the NRF51 SDK.

Thanks

Parents
  • @Aryan, no, I'm not using serialization. What I've done is include nrf_drv_config.h and replace APP_IRQ_PRIORITY_LOW with GPIOTE_CONFIG_IRQ_PRIORITY which is set to APP_IRQ_PRIORITY_LOW, just to keep things tidy. So well, I suggest to make this change on the next SDK revision, the current implementation is quite confusing because you expect the sdk to use the configuration on nrf_drv_config.h

Reply
  • @Aryan, no, I'm not using serialization. What I've done is include nrf_drv_config.h and replace APP_IRQ_PRIORITY_LOW with GPIOTE_CONFIG_IRQ_PRIORITY which is set to APP_IRQ_PRIORITY_LOW, just to keep things tidy. So well, I suggest to make this change on the next SDK revision, the current implementation is quite confusing because you expect the sdk to use the configuration on nrf_drv_config.h

Children
No Data
Related