I am developing with 52840.
We checked button-related problems while using the source that checked the behavior on the DK board on the adafruit-circuit-playground-bluefruit board.
There were two.
1. When the button is active high, it malfunctions.
2. Do not do the long push operation.
So, I revised it as follows.
// BSP.c line 72
#ifndef BSP_SIMPLE
static const app_button_cfg_t app_buttons[BUTTONS_NUMBER] =
{
#ifdef BSP_BUTTON_0
{BSP_BUTTON_0, BUTTONS_ACTIVE_STATE, BUTTON_PULL, bsp_button_event_handler},
#endif // BUTTON_0
#ifdef BSP_BUTTON_1
{BSP_BUTTON_1, BUTTONS_ACTIVE_STATE, BUTTON_PULL, bsp_button_event_handler},
#endif // BUTTON_1
#ifdef BSP_BUTTON_2
{BSP_BUTTON_2, BUTTONS_ACTIVE_STATE, BUTTON_PULL, bsp_button_event_handler},
#endif // BUTTON_2
#ifdef BSP_BUTTON_3
{BSP_BUTTON_3, BUTTONS_ACTIVE_STATE, BUTTON_PULL, bsp_button_event_handler},
#endif // BUTTON_3
#ifdef BSP_BUTTON_4
{BSP_BUTTON_4, BUTTONS_ACTIVE_STATE, BUTTON_PULL, bsp_button_event_handler},
#endif // BUTTON_4
#ifdef BSP_BUTTON_5
{BSP_BUTTON_5, BUTTONS_ACTIVE_STATE, BUTTON_PULL, bsp_button_event_handler},
#endif // BUTTON_5
#ifdef BSP_BUTTON_6
{BSP_BUTTON_6, BUTTONS_ACTIVE_STATE, BUTTON_PULL, bsp_button_event_handler},
#endif // BUTTON_6
#ifdef BSP_BUTTON_7
{BSP_BUTTON_7, BUTTONS_ACTIVE_STATE, BUTTON_PULL, bsp_button_event_handler},
#endif // BUTTON_7
};
#endif // BSP_SIMPLE
// BSP.c line 176
/**@brief Handle events from button timer.
*
* @param[in] p_context parameter registered in timer start function.
*/
static void button_timer_handler(void * p_context)
{
bsp_button_event_handler(bsp_board_button_idx_to_pin(*(uint8_t *)p_context), BSP_BUTTON_ACTION_LONG_PUSH);
}