APPENDIX
return 1;
}
if (Init_ITE8712() == 0)
{
printf(" ITE8712 is not detected, program abort.\n");
return 1;
}
bTime = strtol (argv[1], endptr, 10);
if (bTime == 0)
{
printf("Watch Dog Timer is disabled !!\n", bTime);
DisableWDT();
}
else
{
printf("System will reset after %d seconds\n", bTime);
EnableWDT(bTime);
}
return 0;
}
//=======================================================================
void copyright(void)
{
printf("\n======== ITE8712 Watch Timer Tester (AUTO DETECT) ========\n"\
" Usage : ITE8712 reset_time Unit\n"\
" Ex : ITE8712 3 => reset system after 3 Seconds\n"\
" ITE8712 0 => disable watch dog timer\n");
}
//=======================================================================
void EnableWDT(int interval)
{
Set_ITE8712_LD(0x07); //Set Logic Device 7
Set_ITE8712_Reg(0x72, 0xC0); //Enable WDT
Set_ITE8712_Reg(0x73, interval); //set timer
}
//=======================================================================
void DisableWDT(void)
{
Set_ITE8712_LD(0x07); //switch to logic device 7
Set_ITE8712_Reg(0x72, 0x00); //watchdog disabled
Set_ITE8712_Reg(0x73, 0x00); //Clear watchdog timer
}
//=======================================================================
62 MB879 User’s Manual