|
终于找到原因了。
原来是官方例程中,使用了button_0和button_1.
分别在两函数初始配置,将其屏蔽即解决问题了。
**@brief Function for configuring the buttons for advertisement.
*
* @retval NRF_SUCCESS Configured successfully.
* @return A propagated error code.
*/
static uint32_t advertising_buttons_configure()
{
uint32_t err_code;
err_code = bsp_event_to_button_action_assign(BTN_ID_DISCONNECT,
BTN_ACTION_DISCONNECT,
BSP_EVENT_DEFAULT);
RETURN_ON_ERROR_NOT_INVALID_PARAM(err_code);
err_code = bsp_event_to_button_action_assign(BTN_ID_WHITELIST_OFF,
BTN_ACTION_WHITELIST_OFF,
BSP_EVENT_WHITELIST_OFF);
RETURN_ON_ERROR_NOT_INVALID_PARAM(err_code);
err_code = bsp_event_to_button_action_assign(BTN_ID_SLEEP,
BTN_ACTION_SLEEP,
BSP_EVENT_SLEEP);
RETURN_ON_ERROR_NOT_INVALID_PARAM(err_code);
return NRF_SUCCESS;
}
static uint32_t connection_buttons_configure()
{
uint32_t err_code;
err_code = bsp_event_to_button_action_assign(BTN_ID_SLEEP,
BTN_ACTION_SLEEP,
BSP_EVENT_DEFAULT);
RETURN_ON_ERROR_NOT_INVALID_PARAM(err_code);
err_code = bsp_event_to_button_action_assign(BTN_ID_WHITELIST_OFF,
BTN_ACTION_WHITELIST_OFF,
BSP_EVENT_WHITELIST_OFF);
RETURN_ON_ERROR_NOT_INVALID_PARAM(err_code);
err_code = bsp_event_to_button_action_assign(BTN_ID_DISCONNECT,
BTN_ACTION_DISCONNECT,
BSP_EVENT_DISCONNECT);
RETURN_ON_ERROR_NOT_INVALID_PARAM(err_code);
return NRF_SUCCESS;
}
|
|