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

Failing to understand app_timer

Hello.

I cannot get my head around app_timers. After reading the docs, examples and answers on the devzone I'm still unable to get it running. The timeout callback isn't called after starting the timer. Any assistance, please?

app_timer_id_t timerFoo;

void foobarHandler(void *context)
{
	log("foobar\r\n");
}

int main()
{	
	uartInit();
	log("begin\r\n");
	
	APP_TIMER_INIT(0, 1, 4, NULL);
	if(app_timer_create(&timerFoo, APP_TIMER_MODE_SINGLE_SHOT, foobarHandler) != NRF_SUCCESS) log("creation failed\r\n");
	if(app_timer_start(timerFoo, APP_TIMER_TICKS(2000, 0), NULL) != NRF_SUCCESS) log("starting failed\r\n");
	
	return 0;
}
Related