Keil Logo

User Timers

User Timers are simple timer blocks that count down on every system timer tick. They are implemented as single shot timers. This means you cannot pause and restart these timers. However, you can create and kill the user timers dynamically at runtime. If you do not kill a user timer before it expires, the RTX kernel calls the user provided callback function, os_tmr_call(), and then deletes the timer when it expires.

A timeout value is defined when the timer is created by the os_tmr_create() function.

The RTX kernel calls the callback function with the argument info. The user provides this argument when creating the user timer. The RTX kernel stores the argument in the timer control block. When the timer expires, this argument is passed back to the user in the os_tmr_call() function. If the user kills the timer before the timeout value expires, the RTX kernel does not call the callback function.

You can customize the callback function os_tmr_call() in the RTX_Config.c configuration file.

Note

  • The callback function, os_tmr_call, is called from the system task scheduler. It is recommended to make your os_tmr_call() function as small and fast as possible because the callback function blocks the RTX task scheduler for the length of time it executes.
  • The function os_tmr_call behaves the same way as standard interrupt functions. It is allowed to call the isr_ functions to set an event, send a semaphore, or send a message to other tasks. You cannot call the os_ library functions from os_tmr_call().
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.