Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Button inturrpt works only once

Hi,

We have added support to button click in our design but the intruppt only works once at the first time it is pressed.

What am I missing here? why is the button_evt_handler working only for the first button push?

static void button_evt_handler(uint8_t pin_no, uint8_t button_action)

{

//todo something

}

static void button_init(void)
{
ret_code_t err_code;
const uint8_t buttons_cnt = 1;
static app_button_cfg_t buttons_cfgs =
{
.pin_no = BUTTON_1, 
.active_state = APP_BUTTON_ACTIVE_LOW,
.pull_cfg = NRF_GPIO_PIN_PULLUP,
.button_handler = button_evt_handler
};

err_code = app_button_init(&buttons_cfgs, buttons_cnt, APP_TIMER_TICKS(100));
APP_ERROR_CHECK(err_code);

err_code = app_button_enable();
APP_ERROR_CHECK(err_code);
}

int main(void){

....

button_init();

....

}

Parents Reply
  • i want to remove this button push (registration)..and want function "nrf_ble_es_on_start_connectable_advertising()"

    to be called directly...

    i tried commenting "app_button_init(&buttons_cfgs, buttons_cnt, APP_TIMER_TICKS(100));"

    and then called "nrf_ble_es_on_start_connectable_advertising()"   directly in button_init()..but eddystone is not advertising...i am using sdk15.3 and nrf52832...

    can you help me out

    Thank you

Children
Related