Busy wait function (sa1100.c)
void Wait( unsigned uSec ) {
// waits the specified number of microseconds
volatile unsigned *lTimerOSCRAddress= (unsigned *)OSCR;
Time = *lTimerOSCRAddress;
lValue = Time + (uSec * TIMERTICK);
while (Time < *lTimerOSCRAddress);
while (*lTimerOSCRAddress <= lValue);
#define OSCR 0x90000010 /* OS Timer Counter Registers */#define TIMERTICK 4 /* 1 microsecond is 3.7 clock ticks */