SBC comm SBC-350A Computer Hardware User Manual


 
40 SBC-350A User's Manual
while(1){
if(kbhit()){
inkey=getch();
switch(inkey){
case ‘1’: /* Reset Watchdog timer */
gotoxy(15,11);printf(“Now enable
watchdog timer!”);
outportb(0x443,dog);
run_time=0;
break;
case ‘2’: /* Disable Watchdog timer */
gotoxy(15,11);printf(“Now disable
watchdog timer!”);
outportb(0x43,dog);
break;
case ‘3’: /* Disable Watchdog timer & return to
DOS */
outportb(0x43,dog);
return;
default : break;
}
}
mydelay();
run_time=run_time+1;
/* Display time elapsed */
gotoxy(45,11);printf(“%2d.%1d sec”,run_time/
10,run_time%10);
}
}
/* USER FUNCTION LIBRARY */ void mydelay(void) /*
Delay program: */ /* Delay 109.89ms (18.2Hz*2) */ {
clock_t start,end;
start=clock();
end=start;
while((end-start)<2){
end=clock();
}
}