FWA8206 Series User’s Manual
29
int
c;
setuid(0); /* if we're setuid, force it on */
if ( iopl(3) ) {
fprintf(stderr, "iopl(): %s\n", strerror(errno));
return -1;
}
by_pass_init();
/* Enable watchdog function and retrigger TIMEOUT countdown */
enable_wdt();
for(;;)
{
sleep(1);/* Function check.
if timeout, switch to By Pass mode.
Or , call retrigger() for retrigger WDT. */
/* Display countdown */
outb(0xf6,0x4e);
c = inb(0x4f);
printf("Watchdog
countdown
%d\n",c);
if ( ! c ) {
printf("Switch to Bypass mode !\n");
break;
}
//retrigger();//retrigger watchdog
}
//dis_wdt();//Disable
watchdog
function
return
0;
}