I am using the K60 CANbus. The demo program looks like this:
"#define EXAMPLE_CAN CAN0"
and the relevant section of the header file, MK60D10.h looks like this:
/* CAN - Peripheral instance base addresses */
/** Peripheral CAN0 base address */
#define CAN0_BASE (0x40024000u)
/** Peripheral CAN0 base pointer */
#define CAN0 ((CAN_Type *)CAN0_BASE)
It compiles perfectly.
My code looks like this:
"#define EMS3_CAN CAN0"
and the same section of the local copy of MK60D10.h looks like this:
/* CAN - Peripheral instance base addresses */
/** Peripheral CAN0 base address */
#define CAN0_BASE (0x40024000u)
/** Peripheral CAN0 base pointer */
#define CAN0 ((CAN_Type *)CAN0_BASE) //added comment: error message occurs on this line.
It does not compile, and I get an error in the MK60D10.h file that says:
"expected declaration specifiers or '...' before ( token"
I don't see any difference, which suggests that the error is a bazillion lines away, but I've no idea what to look for.
Any suggestions would be appreciated.
Hello Gary,
Your implementation looks good so I think this could be an error in other sections. Would be possible to share a project where I can replicate this?
Best Regards,
Alexis Andalon
Hi Alexis --
y i
Further testing reveals that it doesn't happen when I create small test programs, it's only in my monster program, which is way too big to burden you with. As long as I know I'm not missing something obvious, I'll try some other things.
Thanks for your help.
Gary