Oops... Write 1000 times "I shall not reformat code before posting".
The BSP_gettimeoffset code I sent out has a bug causing it to ignore lost_ticks: the assignment in the last line before the return should read "+=" and not "=". Here's the revised code.
unsigned short count;
unsigned long lost_ticks;
unsigned long deltat;
/* pick this up as quickly as possible */
count = TCN;
lost_ticks = get_lost_ticks();
/* take care to preserve accuracy and prevent overflow */
/* NOTE: with TCMP set to 0xd7e4 (55268), HZ must be >= 16 */
deltat = (lost_ticks * 1000000) / HZ;
deltat += (count * (1000000 / HZ)) / TCMP;
This message resent by the email@example.com list server http://www.uClinux.com/
This archive was generated by hypermail 2b30 : Sun Apr 07 2002 - 00:01:37 EST