Timer Library (Windows CE 5.0)
The timer library implements the system tick or clock. For more information, see %_WINCEROOT%\Platform\Common\Src\Inc\Oal_timer.h.
You can replace the production-quality OAL implementation, as long as your custom implementation exports the kernel and OAL interfaces. You can replace the timer related functions with the common implementation for the rest of the library.
The production-quality OAL code implementation assumes the timer has a granularity equal to or higher than 1 millisecond with the ability to reduce and extend the system tick. The code uses system tick manipulation in two situations. It is used in OEMIdle to extend the actual system tick beyond the normal system tick period, which is usually 1 millisecond, before it puts the CPU in idle with OAL. It is also used to return the system to the normal tick period when the system returns from idle. When you use kernel profiling, use the system tick manipulation in OEMProfileTimerEnable to reduce the system tick period. In this case, use the period that is shorter than 1 millisecond. To avoid collision with possible timer manipulation in OEMIdle, set the maximum idle period to the normal system tick period.
The production-quality OAL implements a busy loop in the OALCPUIdle function. Use this implementation for development only. The correct implementation of OALCPUIdle depends on the global variable b_oalInterruptFlag, which must be set to TRUE in the interrupt handler code. In the product you release to customers, use the OEMIdle stub, if your hardware does not support idle mode.
See Also
Production-Quality OAL Components | Timer Reference
Send Feedback on this topic to the authors