I am using CodeWarrior for MCU V10.5. with the MPC5606B starterTrak and the PowerPC compiler.
I ran into a problem while trying to add platform based settings to a header file depending on the coretype specified by compiler macros. The PowerPC compiler documentation and CW help states that the compiler will define a macro depending on the employed platform. There is also a nice table in the CW help showing macros for all PPC cores.
For MPC5606B the selected CPU type in the project properties is zen so I would expect that the corresponding macro (__PPCZen__) is defined but it does not seem to be. I changed the cpu to generic expecting to have __PPCGENERIC__ defined but it was not. I also tried to test for __PPC56x__ and several other macros but without success.
Why aren't these macros defined? Does the compiler need an additional option to be set in order to generate these macros? Any help in getting this to work would be appreciated.
Thank you in advance!
Solved! Go to Solution.
Hello lowpy
Please try to use __PPC_ZEN__ and __PPC_GENERIC__. It worked on my side for the generic architecture. It is the problem of editor to display the code in gray. The screenshot shows that the __PPC_ZEN__ does work for MPC5606B project.
Also please note that the architecture marked in properties should match exactly with the macro name (case sensitive).
Best Regards
Fiona Kuang
Technical Information & Commercial Support
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hello lowpy
Please try to use __PPC_ZEN__ and __PPC_GENERIC__. It worked on my side for the generic architecture. It is the problem of editor to display the code in gray. The screenshot shows that the __PPC_ZEN__ does work for MPC5606B project.
Also please note that the architecture marked in properties should match exactly with the macro name (case sensitive).
Best Regards
Fiona Kuang
Technical Information & Commercial Support
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hello Fiona,
Thanks for your reply. It is exactly as you described it. The editor shows the code block as uncompiled and I did not check to see if it actually works.
It was working afterall
Thank you for your help!