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

Multiple App Timers Priority

Hi,

In my application I am using Multiple App timers. Is there a way to prioritise these timers. Are there any draw backs in using multiple timers in "ble app".

Regards Siva

  • The timer library used to create multiple timers uses the RTC1, and the software interrupt SWI0 in APP_LOW priority level. If you want to prioritize between different app timers, you must create your own scheduler function. The pointer to the scheduler function is used during initialization of the app timer, and is called when any timer expires.

    APP_TIMER_INIT(PRESCALER, OP_QUEUE_SIZE, scheduler_function)
    

    A solution is then to add the low priority timers to the scheduler, while high priority timers is run directly in the timer interrupt.

    BLE events will have higher priority than the app timers, so multiple timers will not affect the BLE events.

    You can find more information about the timer library here.

    The Scheduler Tutorial can be found here.

Related