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;
}
}
}
|