
418 Embedded systems design
printf(“\nTime out = %d”,time_out);
printf(“ Transfers attempted: %d\n”,j);
} /* end of data log ELSE */
} while ( (inportb(LPT1+1) & 0x20) == 0x00);
/*
* We are quitting the program so restore and close...
*/
restore();
printf(“ Quitting TCLOG now...\n”);
} /* end of MAIN() */
/*
* This is where the sub-routines live that control the tick ...
*/
void set_rate(int Hz /* This is the sample rate we need */)
{
int rate_hi, rate_lo; /* low and high bytes to program the timer */
int num; /* temp value */
printf(“Changing the BIOS 1/18th tick rate to 1/%d\n”,Hz);
/*
* First calculate the values we need to program...
* If the rate ...