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

button event handler not firing

Hello EveryOne

My button event handler is not being called. following is my code what can be the problem.

uint32_t err_code;


    ble_stack_init();

    timers_init();

    APP_GPIOTE_INIT(1);	

    buttons_init();

    device_manager_init();

    gap_params_init();

    advertising_init();

    services_init();

    conn_params_init();

    Therapy_Init();

    Diagnosis_Init();
    ADC_Init();	

    Pstorage_Initialization();

    // Start detecting button presses.
	err_code = app_button_enable();
    APP_ERROR_CHECK(err_code);

my buttons_init code

static app_button_cfg_t buttons[] =
    {
      17, false, NRF_GPIO_PIN_PULLUP, button_events_handler};

  APP_BUTTON_INIT(buttons, sizeof(buttons) / sizeof(buttons[0]), BUTTON_DETECTION_DELAY, false);}

i have also enabled app_button_enable but then also handler is not getting called.

Regards Asma

Parents
  • my code is working now... in one of my initialization i was using bsp_configurations i.e bsp_buttons_enable after commenting now its working properly Now there is some other problem after i add app_buttons my pstorage is not working . initially i used to sore data in pstorage and at the time of boot up i read the data whatever is stored . now its coming to be all 0xFF. Is there any problem using both together , no other thing is added to the code other than buttons_init and enable.

    Thanks Asma

Reply
  • my code is working now... in one of my initialization i was using bsp_configurations i.e bsp_buttons_enable after commenting now its working properly Now there is some other problem after i add app_buttons my pstorage is not working . initially i used to sore data in pstorage and at the time of boot up i read the data whatever is stored . now its coming to be all 0xFF. Is there any problem using both together , no other thing is added to the code other than buttons_init and enable.

    Thanks Asma

Children
No Data
Related