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

BUTTON_1 release issue

I expanded the button events based on example ble_peripheral ble_app_hrs by

bsp_event_to_button_action_assign (0, BSP_BUTTON_ACTION_RELEASE, BSP_EVENT_KEY_0_RELEASE);
bsp_event_to_button_action_assign (1, BSP_BUTTON_ACTION_RELEASE, BSP_EVENT_KEY_1_RELEASE);
bsp_event_to_button_action_assign (2, BSP_BUTTON_ACTION_RELEASE, BSP_EVENT_KEY_2_RELEASE);
bsp_event_to_button_action_assign (3, BSP_BUTTON_ACTION_RELEASE, BSP_EVENT_KEY_3_RELEASE);

and everything works fine (button press and button release events for all 4 buttons) till I connect the device:

Then button_1 release event (in code: BSP_EVENT_KEY_0_RELEASE) does not appear further more - I do not receive the event also after disconnecting.

Any hint what prevents this event?

  • Hi Joakim,

    thank you for pointing to file bsp_btn_ble.c!

    I modified the lines

    //2020-06-28 pam wakeup and sleep functions disabled
    //by assigning them to button #5 that is not configured
    #define BTN_ID_WAKEUP             5 //0  /**< ID of button used to wake up the application. */
    #define BTN_ID_SLEEP              5 //0  /**< ID of button used to put the application into sleep mode. */
    #define BTN_ID_DISCONNECT         5 //0  /**< ID of button used to gracefully terminate a connection on long press. */
    #define BTN_ID_WAKEUP_BOND_DELETE 5 //1  /**< ID of button used to wake up the application and delete all bonding information. */
    #define BTN_ID_WHITELIST_OFF      5 //1  /**< ID of button used to turn off usage of the whitelist. */
    
    #define BTN_ACTION_SLEEP          BSP_BUTTON_ACTION_LONG_PUSH //BSP_BUTTON_ACTION_RELEASE    /**< Button action used to put the application into sleep mode. */
    #define BTN_ACTION_DISCONNECT     BSP_BUTTON_ACTION_LONG_PUSH  /**< Button action used to gracefully terminate a connection on long press. */
    #define BTN_ACTION_WHITELIST_OFF  BSP_BUTTON_ACTION_LONG_PUSH  /**< Button action used to turn off usage of the whitelist. */

    to disable all the configured functions for wakeup, sleep, etc. and now it works!

    KR Peter

Related