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

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

Jump to solution
1,001 Views
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

Labels (1)
0 Kudos
1 Solution
759 Views
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

View solution in original post

0 Kudos
2 Replies
760 Views
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 Kudos
759 Views
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 Kudos