[TI DLP Buglist]data type error in illum_EnableIllumination function

I am debuging my code today, I find when my code is running, it's stop at illum_EnableIllumination().

After check it, I find my code is in a infinite loop, why it happen?

Just because there is an data type error in the counter, just look at code:

 

uint08 TimeoutCount = 0;

 

    				while ( (!SEQ_GetPhaseLockedToColorWheelIndex()) && TimeoutCount < 1000)
    				{
    					TimeoutCount++;

    					TMR_Delay(300);


 

so when the sequency phase locked is failed, then it will be always a infinite loop.

how to fix it? just change the variable 'TimeoutCount' from uint08 to uint16.

and i also suggest you print a error message if TimtoutCount is bigger or equal to 1000.

 

posted on 2013-08-06 19:15  you Richer  阅读(181)  评论(0编辑  收藏  举报