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:
Description | Resource | Path | Location | Type |
expected identifier before numeric constant | msCANdrv.h | /MSCAN_KEA128/MSCAN_DRIVER/CAN_inc | line 98 | C/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
Solved! Go to Solution.
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
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
Thanks, Jennie! I knew it was define somewhere else but I can't find it! Thank you for pointing that out!