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

cant understand where the schedular uses the timer

I have the following code

 // Initialize timer module, making it use the scheduler
    APP_TIMER_APPSH_INIT(APP_TIMER_PRESCALER, APP_TIMER_MAX_TIMERS, APP_TIMER_OP_QUEUE_SIZE, true);


	//Create timer 1s
	err_code = app_timer_create(&timer_1s_id, APP_TIMER_MODE_REPEATED, timer_1s_timeout_handler);
    APP_ERROR_CHECK(err_code);

how the timer used the schedular , I cant find the code of the SDK the relation between the scheduler and the timer. in which part of the code of schedular the timer_1s_id is bind

Parents
  • The application timer can be used without the scheduler, and vise versa. If you use both the application timer and the scheduler, you should use APP_TIMER_APPSH_INIT() to initialize the application timer, as you do in your code. The code that makes the application timer use the scheduler are located in app_timer_appsh.c and app_timer_appsh.h, which you will find under components\libraries\timer\ in the SDK.

    For a practical guide to the application timer I recommend you to walk through the Application Timer Tutorial. Then, if you need to use the scheduler, you should walk through the Scheduler Tutorial as well.

Reply
  • The application timer can be used without the scheduler, and vise versa. If you use both the application timer and the scheduler, you should use APP_TIMER_APPSH_INIT() to initialize the application timer, as you do in your code. The code that makes the application timer use the scheduler are located in app_timer_appsh.c and app_timer_appsh.h, which you will find under components\libraries\timer\ in the SDK.

    For a practical guide to the application timer I recommend you to walk through the Application Timer Tutorial. Then, if you need to use the scheduler, you should walk through the Scheduler Tutorial as well.

Children
Related