User\main.c(63): error C247: non-address/-constant initializer
代碼如下:請問這個是什么錯誤,我是初學者,懇請各位指導,謝謝。
代碼有寫的不好的,也煩請指正,謝謝
/*固態繼電器動作程序
cnt1:接通時間 cnt2:斷開時間
*/
void SSR_Action(u8 cnt1, u8 cnt2)
{
u16 temp1 = cnt1*1000;
u16 temp2 = cnt2*1000;
bit Heat = 1;
static u16 a1 = temp1; static u16 a2 = temp2;
if(Heat)
{
SSR_CTRL = 1;
a1--;
if(a1 == 0)
{
Heat = 0;
a2 = temp2;
}
}
if(Heat == 0)
{
SSR_CTRL = 0;
a2--;
if(a2 == 0)
{
Heat = 1;
a1 = temp1;
}
}
}
|