Appendix
- 44 -
EC0-1814(B)
outportb(DATA_PORT, 0x08);
outportb(INDEX_PORT, 0x30);
outportb(DATA_PORT, 0x01);
}
(2)
Configure the WDT operating mode to enable or disable WDT
/*
Description: the function, SetWDT, is used to configure the parameter required
when configuring WDT to enable or disable WDT.
Input: Wmode: 0 - Configure WDT to reset mode
IRQ_NO - Configure WDT to interrupt mode. Please
replace the constant IRQ_NO with the interrupt number
need to be used. The available range of the interrupt number
has been listed in the beginning of this chapter
Wtime: 0 - Configure WDT to time by minute
1 - Configure WDT to time by second
Timeout: 0 - disable WDT
TIME_OUT_VALUE - Enable WDT. Please replace the
constant TIME_OUT_VALUE with the unit number of
timeout value (0x01 ~ 0xFF)
Note:
*/
SetWDT(int Wmode, int Wtime, int Timeout)
{
unsigned char oldval;
outportb(INDEX_PORT,0x2d);
oldval = inportb(DATA_PORT);
If (Wmode == 0)
{
oldval &= 0xfe;