I am having problem on while loop.
I wonder why this code is not working:
while this one is working:
Here is how I define the variable:
Also, I use interrupt to change the variable value to 1 to break the while loop. Here is the simplified code:
Does this have to do with the interrupt?
I wonder why this code is not working:
Rich (BB code):
waitForHostReady = 1;
while(waitForHostReady);
Rich (BB code):
waitForHostReady = 1;
while(waitForHostReady)
__delay_us(0);
Rich (BB code):
unsigned char waitForHostReady = 0;
Rich (BB code):
void ISR(void) {
if(waitForHostReady)
waitForHostReady = 0;
}