MSCAN driver and PE code generation. compile error in msCANdrv.h:expected identifier before numeric constant

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

MSCAN driver and PE code generation. compile error in msCANdrv.h:expected identifier before numeric constant

跳至解决方案
1,729 次查看
saya
Contributor III

Hi, all,

 

I am trying to load the msCAN driver into my project these days. I enabled Processor Expert and generated code, but when I include the msCAN drivers, I encountered this error:

DescriptionResourcePathLocationType
expected identifier before numeric constantmsCANdrv.h/MSCAN_KEA128/MSCAN_DRIVER/CAN_incline 98C/C++ Problem

 

I have tested the msCAN example without PE code generation, it works without any error. Thus I am guess there are some redefine in the generated code that cause this error, but I can't find any.

I attached my project here, any enlightenment is appreciated!

 

Alan

Original Attachment has been moved to: MSCAN_KEA128.zip

标签 (1)
0 项奖励
回复
1 解答
1,487 次查看
ZhangJennie
NXP TechSupport
NXP TechSupport

hi Alan,

I open your project with CW10.6. generate pe code then build. I saw "expected identifier before numeric constant" error stopped at ERR_OK line in enum definition in msCANdrv.h.

the problem is ERR_OK is already defined in PE_Error.h:

#define ERR_OK                     

0x00U /*!< OK */

thus if you define it again in enum format in msCANdrv.h. CW produces error.

does this answer your question?  if yes, please click the Correct Answer button. Thank you!


Have a great day,
Zhang Jun

在原帖中查看解决方案

0 项奖励
回复
2 回复数
1,488 次查看
ZhangJennie
NXP TechSupport
NXP TechSupport

hi Alan,

I open your project with CW10.6. generate pe code then build. I saw "expected identifier before numeric constant" error stopped at ERR_OK line in enum definition in msCANdrv.h.

the problem is ERR_OK is already defined in PE_Error.h:

#define ERR_OK                     

0x00U /*!< OK */

thus if you define it again in enum format in msCANdrv.h. CW produces error.

does this answer your question?  if yes, please click the Correct Answer button. Thank you!


Have a great day,
Zhang Jun

0 项奖励
回复
1,487 次查看
saya
Contributor III

Thanks, Jennie! I knew it was define somewhere else but I can't find it! Thank you for pointing that out!

0 项奖励
回复