app_buttons don't work

Hi,

    I have a strange question about app_buttons, I have two buttons, only one of the buttons is initialized, which works well, but once both buttons are initialized at the same time, they will not work. Here is my  initialization program with work well: 

static void button_int(void)
{
uint32_t err_code;

err_code = bsp_event_to_button_action_assign(0, APP_BUTTON_PUSH, BSP_EVENT_DEFAULT);

static const app_button_cfg_t app_buttons[1] =
{
  {FINGER_INT_PIN, APP_BUTTON_ACTIVE_HIGH, NRF_GPIO_PIN_NOPULL, button_callback}
};

err_code = app_button_init((app_button_cfg_t *)app_buttons, 1, 50);
APP_ERROR_CHECK(err_code);

err_code = app_button_enable();
APP_ERROR_CHECK(err_code);
}

  Here is my  initialization program that it do not  work: 

static void button_int(void)
{
uint32_t err_code=NRF_SUCCESS;

err_code = bsp_event_to_button_action_assign(0, BSP_BUTTON_ACTION_RELEASE, BSP_EVENT_DEFAULT);

err_code = bsp_event_to_button_action_assign(1, APP_BUTTON_PUSH, BSP_EVENT_DEFAULT);

static const app_button_cfg_t app_buttons[2] =
{
{BUTTON_SET_PIN, APP_BUTTON_ACTIVE_HIGH, NRF_GPIO_PIN_NOPULL, button_callback},
{FINGER_INT_PIN, APP_BUTTON_ACTIVE_HIGH, NRF_GPIO_PIN_NOPULL, button_callback}
};

err_code = app_button_init((app_button_cfg_t *)app_buttons, 2, 50);
APP_ERROR_CHECK(err_code);

err_code = app_button_enable();
APP_ERROR_CHECK(err_code);
}

I want to konw what is wrong,thanks!

THANKS!

Related