Appendix a - watchdog timer, A.1 sample code, Appendix a, watchdog timer: prese – ADLINK NuPRO-E320 User Manual
Page 85: A appendix: watchdog timer, Sample code
Watchdog Timer
71
NuPRO-E320
Appendix A - Watchdog Timer
A sample program for configuring the NuPRO-E320’s watchdog
timer is included on the ADLINK All-in-One DVD in the following
directory: \NuPRO\NuPRO-E320\WDT.
A.1 Sample Code
#include
#include
#include
#include
void WDTRUN(int config_port,int count_value);
void Enter_IT8718_Config(int config_port);
void Exit_IT8718_Config(int config_port);
void main(int argc,char *argv[])
{
int number,DevID1,DevID2,chipflag=0;
int ioport = 0x2E;//Default config_port = 0x2E
if((argc==1) || ((argc == 3) && (*argv[2] != '4') &&
(*argv[3] != 'E')) || (argc>3))
{
printf("ADLINK Watchdog Timer Utility of NuPRO-
935A \n\n");
printf(" Usage: ITE8718 value [4E]\n");
printf(" value: 1 to 15300 second.\n");
printf(" Write 0 will disable watchdog
timer.\n\n");
printf(" 4E - change IO port to 0x4E.
Default is 0x2E.\n");
exit(1);
}
else
{
// User selected io port.
if(argc==3) { ioport=0x4E;
printf("IOPORT Usage:0x4E \n");
}
//Detect ITE8718F.
Enter_IT8718_Config(ioport);