Hello, everyone!
//single timer setting static void LED_timer_handler(void * p_context) { nrf_gpio_pin_clear(APP_LED_2); //led2 on printf("Left LED ON\n"); } static void timers_init(void) { ret_code_t err_code; // Initialize timer module. err_code = app_timer_init(); APP_ERROR_CHECK(err_code); // Create LED timers. err_code = app_timer_create(&m_LED_timer_id, APP_TIMER_MODE_SINGLE_SHOT, //SINGLE_SHOT or REPEATED //single shot timer LED_timer_handler); } static void LED_timers_start(void) { ret_code_t err_code; // Start application timers. err_code = app_timer_start(m_LeftLED_timer_id, APP_TIMER_TICKS(5000), NULL); //5sec led on APP_ERROR_CHECK(err_code); printf("Led Start\n"); } . . . static void app_button_event_generator(void) { if ((pressed_duration >= 2000) && (pressed_duration < 5000) ){ //press over 2sec NRF_LOG_INFO("Button pressed for 2sec..."); printf("Long button\n"); LED_timers_start(); //timer test }