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)
cnt = t * 100;
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:
while (cnt–) ;
I cant see anything wrong with the code you have posted.
Why dont you use
or similar instead of writing your own arbitrary delay function?
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.