-------------------------------------------------------------------------------
APP_TIMER_DEF(xyz);
static void timer_handler(void* pContext)
{
}
void timer_init(void)
{
app_timer_create(&xyz,APP_TIMER_MODE_REPEATED,timer_handler);
app_timer_start(xyz, 1000, NULL); // 1 sec
}
i want to implement the above code in nRF Connect SDK, i got the two options to implement it , can anyone tell me which is the best way to do it.
------------------------------------------------------------------------------
static struct k_delayed_work xyz;
static void timer_handler(void* pContext)
{
}
void timer_init(void)
{
k_delayed_work_submit(&xyz, K_MSEC(1000));
k_delayed_work_init(&xyz, timer_handler);
}
---------------------------------OR----------------------------------------------
struct k_timer my_timer;
extern void my_expiry_function(struct k_timer *timer_id);
k_timer_init(&my_timer, my_expiry_function, NULL);
----------------------------------------------------------------------------------
if anyone can point out correct example , that would be great.