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

Button interrupt not triggeering

Hi, I am using nRF 511822.I have edited the sample code ble_app_uart and tried to interface the button interrupt handler.But the interrupt is not triggering. I have added the functions
gpiote_init(); and buttons_init();

static void gpiote_init(void)                                                                                                       
{
    APP_GPIOTE_INIT(APP_GPIOTE_MAX_USERS);
}

and

static void buttons_init(void)
{

	    static app_button_cfg_t buttons[] =
    {
			  {SWITCH1, false, BUTTON_PULL, button_event_handler}
 
    };
    
    APP_BUTTON_INIT(buttons, sizeof(buttons) / sizeof(buttons[0]), BUTTON_DETECTION_DELAY, true);
}

and my button interrupt handler is

static void button_event_handler(uint8_t pin_no, uint8_t button_action)                                       
{
    if (button_action == APP_BUTTON_PUSH)                                                                                 
    {
        switch (pin_no)                                                                                                               
        {
						//call function to send the characters 
            case SWITCH1:                                                                                                                
            temp_flag=1;                                                                                                               
                break;            

            default:                                                                                                                      
              APP_ERROR_HANDLER(pin_no);
              break;
        }
    }    
}

Here

  #define SWITCH1        BUTTON_1  

after running the code, the device can connect to the master control panel and also enable the services. But the button interrupt is not triggering.

Can anybody suggest a solution ?

Thanks rahul

Parents Reply Children
No Data
Related