4.10 Using the Timer Function
The I-7188XC(D) can support one main time tick, 8 StopWatch timers
and 8 CountDown timers. The I-7188XC(D) uses a single 16-bit timer to
perform these timer functions, with a timer accuracy of 1 ms. The
InstallUserTimer()
function can be used to install a custom timer
function and the function will be called at 1 ms intervals. The system
timer of the MiniOS7 will call INT 9 every 1 ms and call INT 0x1C every
55 ms. The timer function of the library is linked to associated with
called by hooked to INT 9 and will call any custom timer function.
The
TimerOpen()
function is used to start the I-7188XC(D) timer, and
this function must be inserted at the beginning of the program. The
TimerClose()
function is used to stop the timer. The sample code is as
follows:
unsigned long time iTime;
InitLib(); /* Initiate the 7188xc library */
TimerOpen();
/* Begin using the 7188XC timer function */
while(!quit)
{
if(Kbhit())
TimerResetValue(); /*
Reset
the
main time ticks to 0 */
iTime=TimerReadValue(); /* Read main time ticks */
}
TimerClose(); /* Stop using the 7188XC timer function */
Refer to the demo programs in the
CD:\Napdos\7188XABC\7188XC\Demo\BC_TC\Timer folder for more
information.
I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) ---
66
Содержание I-7188XC Series
Страница 87: ...I 7188XC Series User s Manual Ver 1 0 Apr 2007 7MH 21 10 87...
Страница 136: ...I 7188XC Series User s Manual Ver 1 0 Apr 2007 7MH 21 10 136...
Страница 142: ...Step 8 Make the project I 7188XC Series User s Manual Ver 1 0 Apr 2007 7MH 21 10 142...
Страница 149: ...Step 8 Rebuild the project I 7188XC Series User s Manual Ver 1 0 Apr 2007 7MH 21 10 149...