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

How to define type of event from a button with bsp_event_handler?

I'm trying to develop a Bluetooth application where my Nordic nrf52 DK sends an event when I push the button and another when I release it.

I'm trying to apply this on the bsp_event_handler function but the best that I get is both events being triggered only by the push.

I'm somehow trying to use the following structure from the bsp.h:

typedef struct
{
    bsp_event_t push_event;      /**< The event to fire on regular button press. */
    bsp_event_t long_push_event; /**< The event to fire on long button press. */
    bsp_event_t release_event;   /**< The event to fire on button release. */
} bsp_button_event_cfg_t;

How should I do to specify the event on the bsp_event_handler function?
I also tried to apply what is described here:https://devzone.nordicsemi.com/f/nordic-q-a/49536/button-push-and-release-events
But I didn't have much success with it.
Thank you
Related