#ifdef for projects MCU setting?

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

#ifdef for projects MCU setting?

894 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by cwpjr on Sat Jun 01 15:20:59 MST 2013
I need a way for my source to reference the projects mcu setting.

I currently run on the NXP 1114 board and my own 1114 hw, which require different clock setups.

I tried "mcu variable" and a few other queries of help.

Thanks, Clyde
0 Kudos
Reply
3 Replies

872 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by TheFallGuy on Sun Jun 02 13:02:47 MST 2013
I suggest read about how the c preprocessor works and then ask a sensible question. Hint. What you want is not possible in the way you want but there are lots of ways to do it using the method I suggested
0 Kudos
Reply

872 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by cwpjr on Sun Jun 02 11:58:28 MST 2013
I need to have my source code compile different code based on the project MCU settings,
as in :

#ifdef {TargetMCU} == "LPC1114/301"
//setup clocks this way
#endif
#ifdef {TargetMCU} == "LPC1114FD/102"
//setup clocks another way
#endif
0 Kudos
Reply

872 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by TheFallGuy on Sun Jun 02 02:44:18 MST 2013
Take a look at

http://support.code-red-tech.com/CodeRedWiki/BuildMacros

You could use -D${TargetMCU} to the compiler
0 Kudos
Reply