gpt4 book ai didi

c - 错误 : initializer element is not constant in C

转载 作者:行者123 更新时间:2023-12-04 11:26:36 24 4
gpt4 key购买 nike

<分区>

在这里,我试图制作状态机,FsmHdlr 应该根据状态和事件调用适当的函数。我收到上述错误。如何解决这个问题。

   S16 handleParamReqEvt(void)
{
/* doing something */
RETVALUE(ROK);
}

S16 handleParamRspEvt(param_resp *paramRsp)
{
/* doing something */
RETVALUE(ROK);
}

typedef enum{
IDLE,
CONFIGURED,
MAX_STATE
}STATE;

/* Events in CL */
typedef enum{
PARAM_REQ,
PARAM_RSP
MAX_EVENT
}EVENT;

param_resp *paramMsg;

S16 FsmHdlr[MAX_STATE][MAX_EVENT] =
{
{
/* PHY_STATE_IDLE */
handleParamReqEvt(), //error :initializer element is not constant
handleParamRspEvt(paramMsg) //error: initializer element is not constant
}
};

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com