I know this was asked before, but none of the posts address my problem. There is a similar thread , but the issue on that one was that the softdevice was not being used. I'm using S210 softdevice and trying to make a current efficient delay using a timer, but my handler is never called:
// do nothing
static void delay(void * p_context)
{
// do nothing
}
app_timer_id_t module_init(void)
{
// Initialize and start a single shot timer, which is used as a delay
APP_TIMER_INIT(RTC_PRESCALER, 1u, 1u, false);
app_timer_id_t timer_id;
uint32_t err_code = app_timer_create(&timer_id, APP_TIMER_MODE_SINGLE_SHOT, delay);
APP_ERROR_CHECK(err_code);
return (timer_id);
}
app_timer_id_t timer_id;
{
.
.
.
timer_id = module_init();
uint32_t err_code = app_timer_start(timer_id, 50u, NULL);
app_timer_stop(timer_id);
.
.
.
.
}