This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

I found a problem in the BSP button example.

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);
}

Parents
  • Hi,

    I'm not sure I understand the issue, what exactly do you mean by malfunctions? Are you using a Nordicsemi development kit? The BSP library is meant to be used with our development kit, if you're using a third-party board then you might have to modify it.

    regards

    Jared 

  • I am using a dk board and a "circuit playground bluefruit" board for testing.
    There was a problem when I checked the normal operation on the DK board and tested the firmware on the "circuit playground bluefruit" board.

    Of course, I know that BSP was made for DK board.

    Many people use Nordic and refer to BSP.
    The same problem will occur when using a high active switch.
    It was written for sharing because I couldn't find an article about this online.

    BSP can also be used on High Active switches with simple modifications.

    Thank you.

Reply
  • I am using a dk board and a "circuit playground bluefruit" board for testing.
    There was a problem when I checked the normal operation on the DK board and tested the firmware on the "circuit playground bluefruit" board.

    Of course, I know that BSP was made for DK board.

    Many people use Nordic and refer to BSP.
    The same problem will occur when using a high active switch.
    It was written for sharing because I couldn't find an article about this online.

    BSP can also be used on High Active switches with simple modifications.

    Thank you.

Children
No Data
Related