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

How to use app_timer with app_scheduler S110 v8.0.0

It looks like APP_TIMER_INIT changed in v8 of the SDK. I do NOT want to run the code for timer callbacks in the IRQ, I want to run in the background loop. How should I properly initialize the app_timer module? Is there a tested example I can refer to?

#include "app_timer.h"
#include "app_scheduler.h"

// Initialize timer module
APP_TIMER_INIT(APP_TIMER_PRESCALER,
               APP_TIMER_MAX_TIMERS,
               APP_TIMER_OP_QUEUE_SIZE,
               app_timer_evt_schedule); // <-- this is undefined

// Create a timer
err_code = app_timer_create(&sample_timer_id,
                          APP_TIMER_MODE_REPEATED,
                          OnSensorMeasurementTimerExpired);
APP_ERROR_CHECK(err_code);

// Initialize the scheduler module
APP_SCHED_INIT(MY_APP_SCHED_MAX_EVENT_DATA_SIZE, MY_APP_SCHED_QUEUE_SIZE);

What should MY_APP_SCHED_MAX_EVENT_DATA_SIZE and MY_APP_SCHED_QUEUE_SIZE be?

Related