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

Problem using multiple GPIOTE users

I tried changing the define below from 1 to 2, so I could have one handler for a button and a different handler for other sensors. But my problem is:

  1. If I set it to 1, the button handler (which is initialized first) is the only that works.
  2. If I set it to 2, the sensors handler is the only one that works (it's initialized second, as if it took over the spot from the other).

#define APP_GPIOTE_MAX_USERS 2 /**< Maximum number of users of the GPIOTE handler. */

Parents
  • Since you haven't provided any further details here, it's hard to be specific, but there is a couple of things that it's useful to be aware of:

    1. app_gpiote does not set the direction of your pins. You should therefore make sure to do this separately in your own code, before initing app_gpiote.
    2. An app_gpiote user is not enabled by default, and you have to explicitly call app_gpiote_user_enable() with the app_gpiote_user_id_t of your application to get any interrupts.
Reply
  • Since you haven't provided any further details here, it's hard to be specific, but there is a couple of things that it's useful to be aware of:

    1. app_gpiote does not set the direction of your pins. You should therefore make sure to do this separately in your own code, before initing app_gpiote.
    2. An app_gpiote user is not enabled by default, and you have to explicitly call app_gpiote_user_enable() with the app_gpiote_user_id_t of your application to get any interrupts.
Children
No Data
Related