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,293件の閲覧回数
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,051件の閲覧回数
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,052件の閲覧回数
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,051件の閲覧回数
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 件の賞賛
返信