用IAR调试代码时,出现了图片所示的错误,编译器都已经都过了,但却读不出变量的值,好奇怪,哪位大神可以指点一下吗?void PWM_Process(void)
{
uint8_t i=0,j=0;
uint16_t usDuty=0;
uint16_t usPwmStep=0;
uint16_t usSum=0;
uint16_t usColorValue=0;
uint8_t ucLightnessValue=0;
uint8_t ucPwmLevel_a[2]={0};
if(!Key_GetPowerValue())
return;
usColorValue=stPwm.usColor;
ucLightnessValue=stPwm.ucLightness;
ucLightnessValue/=PWM_LIGHTNESS_STEP;
usColorValue=(usColorValue-PWM_COLOUR_MIN)/PWM_COLOR_STEP;
usSum=(uint16_t)ucLightnessValue*(PWM_COLOUR_MAX-PWM_COLOUR_MIN)/PWM_COLOR_STEP*ucColourLevel_a[usColorValue]/ucColourLevel_a[0];
ucPwmLevel_a[0]=((uint16_t)ucLightnessValue*usColorValue)*ucColourLevel_a[usColorValue]/ucColourLevel_a[0];//pwm1
ucPwmLevel_a[1]=(uint16_t)usSum-ucPwmLevel_a[0];//pwm2
usPwmStep=(uint16_t)(PWM_VALUE_MAX-PWM_VALUE_MIN)*100/(PWM_LEVEL_MAX-1);
#if 1
for(i=0;i<PWM_NUM;i++)
{
if(ucPwmLevel_a[i])
{
usDuty=(uint16_t)PWM_VALUE_MAX*100;
for(j=1;j<ucPwmLevel_a[i];j++)
{
usDuty-=usPwmStep;
}
usDuty/=100;
}//end if
else
{
usDuty=800;
}
PWM_DutySet(i,usDuty);
}
#endif
}
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
勾选上了
一周热门 更多>