FWA8206 Series User’s Manual
28
outb(0x0,0x4f);
outb(0xaa,0x4e); // Exit extended mode
sleep(1);
}
#define TIMEOUT
10
void enable_wdt (void) {
unsigned int i=0;
outb(0x87,0x4e);//Enter extended function mode
outb(0x87,0x4e);
outb(0x2b,0x4e);
i = inb(0x4f);
i &= 0xef;//Configure bit 4 as 0 to be watchdog function.
outb(0x2b,0x4e);
outb(i,0x4f);
outb(0x7,0x4e);
outb(0x8,0x4f);//watchdog in logic device 8
outb(0x30,0x4e);//Active wdt
outb(0x1,0x4f);
outb(0xf5,0x4e);
i = inb(0x4f);
/*Select watchdog count mode */
//i = i | 0x8; //Select minute
i = i & 0xf7; //Select second
outb(0xf5,0x4e);
outb(i,0x4f);
outb(0xf6,0x4e);
outb(TIMEOUT,0x4f);
outb(0xf7,0x4e);
outb(0x0,0x4f);
}
void retrigger ( void ) {
outb(0xf6,0x4e);
outb(TIMEOUT,0x4f);
}
/* Disable WDT function */
void dis_wdt ( void ) {
outb(0xf6,0x4e);
outb(0x00,0x4f);
}
int main(int argc, char **argv)
{