Hi
I am debugging this code, and when I get to the yellow line at first the counter is less than end, but even after counter > end it still stays in the while. I tried to add the if statement in the while, but it seems the compiler ignores it ane way, I cant add a breakpoint on this line.
it is very strange. what can be the problem?
I run it on the launchpad with the same results
void
o_timersQ_delay2(DWORD delay) //in mSec
{
DWORD end, start = systick_counter;
end = systick_counter + (delay /SYSTICK_PER); //find what the counter should be at the end of the delay
if (end > start)
{
while (systick_counter < end) //in regular case // from some reason it doesnt work
{
if (systick_counter > end) break;
}
}
else //when the end is after overflow
{
if (systick_counter >= start) //until the overflow
while (systick_counter > end);
else //after the ofer flow
while (systick_counter < end);
}
}