Partager via


Timer (OAL) (Compact 7)

3/12/2014

The Windows Embedded Compact scheduler relies on a system timer to provide system ticks, power-saving functionality, and other actions and information related to time. The header file that defines the OAL timer module interface is Platform\Common\Src\Inc\oal_timer.h. The timer functions are linked into oal.lib.

The following are examples of timer code locations:

  • Platform\Common\Src\Common\Timer
  • Platform\Common\Src\SOC\<SOC Name>\OAL\Timer
  • Platform\Common\Src\<CPU Family>\Common\Timer

The following table lists the main timer functions. In addition to these functions, Timer Reference describes other functions related to timer activity. The common timer code that comes with Windows Embedded Compact contains CPU-family-specific implementations that you may be able to use with little modification. For example, Platform\Common\Src\MIPS\Common\Timer\Vartick\timer.c provides timer function implementations that are suitable for variable-tick timers in MIPS-based CPUs and SOCs.

Purpose Function name Typical file name

Initializes timer

OALTimerInit, OALTimerInitCount

timer.c, init.c

Handles timer interrupts

OALTimerIntrHandler

timer.c

Gets timer information

OALTimerGetCount, OALTimerGetCompare, OALGetTickCount

timer.c, count.s

Sets timer

OALTimerSetCompare, OALTimerUpdate, OALTimerRecharge

timer.c, count.s, cntcmp.c

See Also

Concepts

OAL Code Overview