Custom Embedded Solutions
WIN Enterprises, Inc MB-80510 User Manual
53
//Set Time-out Value
if(argv[2] == NULL){
help();
return;
}
else{
Enter_sio_config();
outportb(index_port, 0xF6);
outportb(data_port , 0x00);
//Clear Status
outportb(index_port, 0xF5);
data_rw8 = 0x32;
data_rw8 |= 0x08;
outportb(data_port, data_rw8);
sscanf(argv[2], "%d", &time);
outportb(index_port, 0xF6);
outportb(data_port, time);
if(time==0){
//Disable count
outportb(index_port, 0xF5);
data_rw8 = inportb(data_port)&0xCF;
outportb(data_port , data_rw8);
}
else{
outportb(index_port, 0xFA);
outportb(data_port , 0x01);
//Enable reset function
}
printf("Watchdog Timer will count down for %d minute(s)\n", time);
}
}
Exit_sio_config();
return;
}
void Enter_sio_config()
//Enter W83627EHF Configuration
{
outportb(index_port, 0x87);
delay(1);
//Delay some time