
Custom Embedded Systems
WIN Enterprises. Inc. MB-73350 User Manual
39
if(strcmp(argv[1], "-s") == 0){
//Show Watchdog Register Settings
Enter_sio_config();
outportb(index_port, 0xF5);
data_rw8 = inportb(data_port)&0x08;
if(data_rw8 == 0x00){
//second mode
outportb(index_port, 0xF6);
data_rw8 = inportb(data_port);
printf("Second mode: %d second\n", data_rw8);
}
else{
//minute mode
outportb(index_port, 0xF6);
data_rw8 = inportb(data_port);
printf("Minute mode: %d minute\n", data_rw8);
}
}
else if(strcmp(argv[1], "-t") ==0 ){
//Set Time-out Value
if(argv[2] == NULL){
help();
return;
}
else{
Enter_sio_config();
outportb(index_port, 0xFA);
data_rw8 = inportb(data_port)|0x01;
outportb(data_port, data_rw8);
outportb(index_port, 0xF5);
data_rw8 = inportb(data_port)&0xF7|0x31;
outportb(data_port, data_rw8);
sscanf(argv[2], "%d", &data_rw8);
outportb(index_port, 0xF6);
outportb(data_port, data_rw8);
printf("Watchdog Timer will count down for %d second(s)\n", data_rw8);