System Tick Timer Implementation (Windows Embedded CE 6.0)
1/5/2010
You must implement the system tick timer as part of the OAL.
Note
On ARM-based processors, you do not need to call HookInterrupt. All interrupts are serviced by the OEMInterruptHandler function.
The system tick is the only interrupt required by the kernel and you must hook the interrupt with HookInterrupt and then provide a system tick interrupt service routine (ISR) to handle the tick.
When threads are active in the system the system tick timer goes off every millisecond. The system tick ISR updates CurMSec every millisecond so blocking operations and GetTickCount calls are as accurate as possible.
The tick ISR only returns SYSINTR_RESCHED to the kernel's interrupt dispatcher if a thread scheduling event is ready to occur; that is, if dwReschedTime is less than or equal to CurMSec.
If no scheduling event is ready, the ISR returns SYSINTR_NOP. SYSINTR_NOP indicates that the interrupted thread will be resumed immediately, without having to wait for the kernel to run its scheduling algorithm.
The system tick ISR does not schedule an interrupt service thread (IST). It returns the appropriate SYSINTR_* value, which causes the kernel to schedule an IST as needed.
To test that the system tick has been initialized and functional, you can write to a LED when a system tick occurs.
See Also
Tasks
Implementing the OEMInit Function
How to Develop an OEM Adaptation Layer