CO_Data ObjDict_Data = CANOPEN_NODE_DATA_INI
tiALIZER(ObjDict);
IAR编译提示Error[Pe253]: expected a "," 错误指向CO_Data
Error[Pe253]: expected a "," 错误指向CO_Data
Error[Pe253]: expected a "," 错误指向CANOPEN_NODE_DATA_INITIALIZER(ObjDict)
自己比对发现并没有什么问题,但一直编译不过,希望可以指出来什么问题!什么感谢!
其中CO_Data 为如下结构体:
struct struct_CO_Data {
//* Object dictionary
UNS8 *bDeviceNodeId; //节点地址
const indextable *objdict;
s_PDO_status *PDO_status; //PDO传输类型
INTEGER16 *RxPDO_EventTimers;
void (*RxPDO_EventTimers_Handler)(CO_Data*, UNS32);
const quick_index *firstIndex;//起始索引
const quick_index *lastIndex;//终止索引
const UNS16 *ObjdictSize;
const UNS8 *iam_a_slave;
valueRangeTest_t valueRangeTest;
// SDO
s_transfer transfers[SDO_MAX_SIMULTANEOUS_TRANSFERTS];
// State machine
e_nodeState nodeState;
s_state_communication CurrentCommunicationState;
initialisation_t initialisation;
preOperational_t preOperational;
operational_t operational;
stopped_t stopped;
void (*NMT_Slave_Node_Reset_Callback)(CO_Data*);
void (*NMT_Slave_Communications_Reset_Callback)(CO_Data*);
// NMT-heartbeat
UNS8 *ConsumerHeartbeatCount;
UNS32 *ConsumerHeartbeatEntries;
INTEGER16 *ConsumerHeartBeatTimers;
UNS16 *ProducerHeartBeatTime;
INTEGER16 ProducerHeartBeatTimer;
heartbeatError_t heartbeatError;
e_nodeState NMTable[NMT_MAX_NODE_ID];
// /* NMT-nodeguarding */
INTEGER16 GuardTimeTimer;
INTEGER16 LifeTimeTimer;
nodeguardError_t nodeguardError;
UNS16 *GuardTime;
UNS8 *LifeTimeFactor;
UNS8 nodeGuardStatus[NMT_MAX_NODE_ID];
// SYNC
INTEGER16 syncTimer;
UNS32 *COB_ID_Sync;//只可写入0x80(同步器不工作)与0x40000080(激活同步发生器)
UNS32 *Sync_Cycle_Period;//同步周期
post_sync_t post_sync;
post_TPDO_t post_TPDO;
post_SlaveBootup_t post_SlaveBootup;
post_SlaveStateChange_t post_SlaveStateChange;
//General
UNS8 toggle;
CAN_PORT canHandle; //选择CAN1或者CAN2
scanIndexOD_t scanIndexOD; //
storeODSubIndex_t storeODSubIndex;
// DCF concise
const indextable* dcf_odentry;
UNS8* dcf_cursor;
UNS32 dcf_entries_count;
UNS8 dcf_status;
UNS32 dcf_size;
UNS8* dcf_data;
// EMCY
e_errorState error_state;
UNS8 error_history_size;
UNS8* error_number;
UNS32* error_first_element;
UNS8* error_register;
UNS32* error_cobid;
s_errors error_data[EMCY_MAX_ERRORS];
post_emcy_t post_emcy;
};
CANOPEN_NODE_DATA_INITIALIZER(ObjDict);为如下宏定义
#define CANOPEN_NODE_DATA_INITIALIZER(NODE_PREFIX){
/* Object dictionary*/
NODE_PREFIX ## _bDeviceNodeId, /* bDeviceNodeId */
NODE_PREFIX ## _objdict, /* objdict */
NODE_PREFIX ## _PDO_status, /* PDO_status */
NULL, /* RxPDO_EventTimers */
_RxPDO_EventTimers_Handler, /* RxPDO_EventTimers_Handler */
NODE_PREFIX ## _firstIndex, /* firstIndex */
NODE_PREFIX ## _lastIndex, /* lastIndex */
NODE_PREFIX ## _ObjdictSize, /* ObjdictSize */
NODE_PREFIX ## _iam_a_slave, /* iam_a_slave */
NODE_PREFIX ## _valueRangeTest, /* valueRangeTest */
/* SDO, structure s_transfer */
{
REPEAT_SDO_MAX_SIMULTANEOUS_TRANSFERS_TIMES(s_transfer_Initializer)
},
/* State machine*/
Unknown_state, /* nodeState */
/* structure s_state_communication */
{
0, /* csBoot_Up */
0, /* csSDO */
0, /* csEmergency */
0, /* csSYNC */
0, /* csHeartbeat */
0, /* csPDO */
0 /* csLSS */
},
_initialisation, /* initialisation */
_preOperational, /* preOperational */
_operational, /* operational */
_stopped, /* stopped */
NULL, /* NMT node reset callback */
NULL, /* NMT communications reset callback */
/* NMT-heartbeat */
NODE_PREFIX ## _highestSubIndex_obj1016, /* ConsumerHeartbeatCount */
NODE_PREFIX ## _obj1016, /* ConsumerHeartbeatEntries */
NODE_PREFIX ## _heartBeatTimers, /* ConsumerHeartBeatTimers */
NODE_PREFIX ## _obj1017, /* ProducerHeartBeatTime */
TIMER_NONE, /* ProducerHeartBeatTimer */
_heartbeatError, /* heartbeatError */
{REPEAT_NMT_MAX_NODE_ID_TIMES(NMTable_Initializer)},
/* is well initialized at "Unknown_state". Is it ok ? (FD)*/
/* NMT-nodeguarding */
TIMER_NONE, /* GuardTimeTimer */
TIMER_NONE, /* LifeTimeTimer */
_nodeguardError, /* nodeguardError */
NODE_PREFIX ## _obj100C, /* GuardTime */
NODE_PREFIX ## _obj100D, /* LifeTimeFactor */
{REPEAT_NMT_MAX_NODE_ID_TIMES(nodeGuardStatus_Initializer)},
/* SYNC */
TIMER_NONE, /* syncTimer */
NODE_PREFIX ## _obj1005, /* COB_ID_Sync */
NODE_PREFIX ## _obj1006, /* Sync_Cycle_Period */
/* NODE_PREFIX ## _obj1007, */ /* Sync_window_length */
_post_sync, /* post_sync */
_post_TPDO, /* post_TPDO */
_post_SlaveBootup, /* post_SlaveBootup */
_post_SlaveStateChange, /* post_SlaveStateChange */
/* General */
0, /* toggle */
NULL, /* canSend */
NODE_PREFIX ## _scanIndexOD, /* scanIndexOD */
_storeODSubIndex, /* storeODSubIndex */
/* DCF concise */
NULL, /*dcf_odentry*/
NULL, /*dcf_cursor*/
1, /*dcf_entries_count*/
0, /* dcf_status*/
0, /* dcf_size */
NULL, /* dcf_data */
/* EMCY */
Error_free, /* error_state */
sizeof(NODE_PREFIX ## _obj1003) / sizeof(NODE_PREFIX ## _obj1003[0]), /* error_history_size */
NODE_PREFIX ## _highestSubIndex_obj1003, /* error_number */
NODE_PREFIX ## _obj1003[0], /* error_first_element */
NODE_PREFIX ## _obj1001, /* error_register */
NODE_PREFIX ## _obj1014, /* error_cobid */
/* error_data: structure s_errors */
{
REPEAT_EMCY_MAX_ERRORS_TIMES(ERROR_DATA_INITIALIZER)
},
_post_emcy, /* post_emcy */
}