I have a flag (as a global variable) which is waiting for a certain time to pass before being set. I have a while loop which waits for the flag to set before proceeding. The global variable does get set to '1' but the while loop does not exit, any ideas what I'm doing wrong:
while (TC3Flag == 0); //Global Flag Variabe TC3Flag, 0 = Not Set, 1 = Set
TurnOnFive();
TurnOnTwelve();
TC3Flag = 0;
Edit i also have tried with the same results, I do want the processor to do nothing while the flag is 0 and only call TurnOnFive and TurnOnTwleve after the flag is set
while (TC3Flag == 0) {}
TurnOnFive();
TurnOnTwelve();
TC3Flag = 0;
EDIT EDIT: Adding volitile to the TC3FLag declaration fixed it.