Content originally posted in LPCWare by starblue on Fri Mar 27 02:33:56 MST 2015
Quote: efiLabs
my solution was
ulong h0 = LPC_RITIMER->COUNTER_H ;
ulong lo = LPC_RITIMER->COUNTER ;
ulong h1 = LPC_RITIMER->COUNTER_H ;
and if h0 != h1 reread the low part
That's what I do in similar situations, loop while the reading of the high part changes. Under any realistic system load the loop should terminate very quickly, rereading at most once (if not you have serious problems elsewhere).