I need to poll a status register for a condition that can take from 32us up to 16ms depending on a number of entries.
I was using IOSleep( max(1, num * 32 / 1000) ) in loop while checking for the condition.
It works but I was wondering if I should use IODelay when num is small?
int loop = 4;
while ( --loop && !condition(&num) )
if (num < 20)
IODelay(num * 32);
IOSleep( max(1, num * 32 / 1000) );
Or should I just poll the condition with no sleep, no delay when num is small, and use IOSleep when num is above 31?
Thanks for your advice,
Do not post admin requests to the list. They will be ignored.
Darwin-drivers mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden