给程序加#include "
timea_isr.h"错误提示是:Error while running C/C++ compiler
删掉#include "timea_isr.h"错误提示子程序timea_isr中的P都出错Error[Pe020]: identifier "p" is undefined C:UsersAdministratorDesktop;Error while running C/C++ compiler ;Error while running C/C++ compiler ;Error[Pe020]: identifier "num" is undefined C:UsersAdministratorDesktop;
子程序如下:
#pragma vector=TIMERA0_VECTOR
__interrupt void timea_isr(void)
{
if(CCR1>num) //占空比逐渐减小
{
{
p=CCR1-num;
do{
CCR1-=i;
p-=i;
}
while( p=0 );
CCR1==pwm;
}
if(CCR1<num)//占空比逐渐增大
p=num-CCR1;
do{
CCR1+=i;
p=p-i;
}while( p=0 );
CCR1==pwm;
}
else
CCR1=num;
CCR1==pwm;
}
;
拜托大神!!!!
一周热门 更多>