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
Look-up the standard 'C' keyword volatile in your textbook...
See also: blog.regehr.org/.../28
i now fix it good
void DelayUSec (uint32_t Time) { Delay_Done = Time; while(!Delay_Done) Delay_Done = Delay_Done-1; }
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