Hi,
I have encounter a problem that the first button release event is missing if the key is pressed while powering up.
The SDK I am using is nRF5_SDK_17.0.0_9d13099.
Below is my code when initializing the buttons using the bsp.
static void buttons_leds_init(bool * p_erase_bonds) { ret_code_t err_code; bsp_event_t startup_event; err_code = bsp_init(BSP_INIT_LEDS | BSP_INIT_BUTTONS, bsp_event_handler); APP_ERROR_CHECK(err_code); err_code = bsp_event_to_button_action_assign(2, BSP_BUTTON_ACTION_RELEASE, BPS_EVENT_KEY_2_RLEASE); APP_ERROR_CHECK(err_code); err_code = bsp_btn_ble_init(NULL, &startup_event); APP_ERROR_CHECK(err_code); *p_erase_bonds = (startup_event == BSP_EVENT_CLEAR_BONDING_DATA); }
The procedure to repeat the problem is as below:
- press the button #2
- power up / reset the nrf52832
- release the button
- release event for button #2 is not triggered
However, if the button is not pressed when power up. The first button press event is triggered.
Just the first release event is missing but after the first one, everything works fine.
Any idea how to solve this? Or I can use other software module rather than the bsp?
Thanks,
Jones