System Installation
WADE-8022 User’s Manual
3-5
outportb (EC_DATA, index);
IBF_Check
();
outportb
(EC_DATA,
data);
}
static unsigned char Read_EC (unsigned char address)
{
unsigned char data;
IBF_Check
();
outportb (EC_CMD, EC_CMD_READ);
IBF_Check
();
outportb
(EC_DATA,
address);
OBF_Check();
data = inportb (EC_DATA);
return
data;
}
void EC_WDT_Trigger ()
{
/* WDT Counter */
Write_EC (WDT_SEC, 0x05);
/* if use minute mode */
/* Write_EC (WDT_MIN, 0x05); */
/* 0x01 is second mode */
/* 0x03 is minute mode */
Write_EC (WDT_MODE, 0x01);
}
int main ()
{
int
i;
EC_WDT_Trigger
();
for (i = 0; i < 5; i++)
{
printf ("Reset counter ...................%d\n", 5 - i);
delay
(1000);
}
return
0;
}