void DelayUSec (uint32_t Time) { Delay_Done = 0; while(!Delay_Done); }
void Handler (void) { if (Stat & 0x01) { if (!Delay_Done) Delay_Done = 1; }
}
it never come out of my loop
You fixed one bug but did not follow Andys tip. What do you think happens if you change compiler version or compiler optimization settings?
By the way - do google a bit for software delay loops, and you will find a lot of comments about how bad they are.
Here, for starters: http://www.keil.com/forum/docs/thread16698.asp