![](https://pdfstore-manualsonline.prod.a.ki/pdfasset/4/44/44414c02-d064-4424-ae12-8acc58561d02/44414c02-d064-4424-ae12-8acc58561d02-bg88.png)
iVIEW-100 Series user’s Manual, 2006, v2.0 ----- 136
InstallUserTimer1C()
Func.: Install user's timer function on interrupt 0x1c. System timer will call int 0x1c
every 55 ms.
Syntax:
void InstallUserTimer1C(void (*fun)(void));
Header: #include ”iVIEW.h”
Description:
fun: The user's function pointer. The function cannot use input agument, and
can not return value.
Example: Please refer to “InstallUserTimer()” for silimar information.
EnableWDT()
Func.: Enable the Watchdog timer.
Syntax:
void EnableWDT(void);
Header: #include ”iVIEW.h”
Description:
The WatchDog Timer(WDT) is always enable, and the system Timer ISR will
refresh it.
When user's program call EnableWDT(), the system timer ISR will stop to
refresh WDT, and user's program must do it by cal
l RefreshWDT(). Otherwise,
the system will be reset by WDT. The timeout period of WDT is 0.8 seconds.
Example:
(wchdog.c)
#include"iview.h"
#include"mmi100.h"
void main(void)
{
int quit=0,k;
InitLib();
if(IsResetByWatchDogTimer()) /*test if reset by WDT*/
Print("reset by WatchDog timer\n\r");
EnableWDT(); /*after call EnableWDT, must call refresh in 0.8s*/
while(!quit){
if(Kbhit()) {
k=Getch();
if(k=='q') {
Print("quit program\r\n");
quit=1; /*quit the program*/
}
else {
Print("over 0.8s, Reset system\r\n");
Delay(1000); /*delay over 0.8s, reset system*/
}
}
RefreshWDT(); /*must call refresh WDT in 0.8s*/
Print("call Refresh WDT\n\r");
}
DisableWDT(); /*disable WDT, system will refresh WDT*/
Print("call DisableWDT\n\r");
}