Can someone tell me what is wrong with this code. I am trying to create a busy wait function. If I call the wait function from multiple costates, the debugger reports that the costate info is trashed.
cofunc void busywait(int t)
{
int cnt;
cnt = t * 100;
while (cnt–)
yield;
}
I believe that you need a semicolon after “while (cnt–)” so that the loop executes a null-statement.
As written, you’re actually executing “while (cnt–) yield;” instead.
After making the same mistake I always leave whitespace before the semicolon so it’s evident in the source code. I suggest either:
We are bringing up new hardware and for some reason the Delay functions never timeout. This was an attempt to create a busy wait version to get around the hardware issue.