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

Interrupt not Registering Using app_gpiote

I am having an issue with pin changes triggering interrupts using app_gpiote. I've set up app_gpiote to watch pin 30 and trigger an interrupt on low-to-high or high-to-low. I've followed the example code closely, but the pin change (up or down) does not cause the interrupt handler to start. I am certain the pin change is occurring because I am monitoring it with a logic analyzer. Here is my code.

    static void event_handler_int(uint32_t event_pins_low_to_high, uint32_t event_pins_high_to_low)
    {nrf_gpio_pin_toggle(LED_0);}


    static bool gpiote_init(void)
    {
        uint32_t retval;

        nrf_gpio_cfg_output(LED_0);
        nrf_gpio_cfg_output(LED_1);

        APP_GPIOTE_INIT(APP_GPIOTE_MAX_USERS);

        retval = app_gpiote_user_register(&my_user_id,
                                1 << 30,
                                1 << 30,
                                event_handler_int);
       if(retval != NRF_SUCCESS)
       {
	        return false;
       }

       retval = app_gpiote_user_enable(my_user_id);
       if(retval != NRF_SUCCESS)
       {
	       return false;
       }

      return true;
   }

The gpiote_init function returns true, so it seems that the various initialization calls to app_gpiote are functioning properly. Any idea what is going on here?

P.S. Apologies for the messed up code formatting, can't seem to figure out the issue with it...

Parents Reply Children
No Data
Related