Content originally posted in LPCWare by PoolCop on Thu Jan 30 11:27:45 MST 2014
Hi guys,
I'm using timer0 IRQ handler to build delay.
I use a global static integer called "One_ms_tick" which is preset when entering the Delay_ms routine.
Then Delay_ms routine is waiting for "One_ms_tick" to be back to zero in a while statment.
Timer0 IRQ handler is in charge to decrease "One_ms_tick" every milli-seconds until zero.
As shown is the attached pict, even if "One_ms_tick" is decreased back to zero (I can see the value decreasing in debug mode), the Delay_ms routine stays stuck in the while instruction.
Any clue ?
Thanks
René