µTasker Forum

µTasker Forum => NXPTM M522XX, KINETIS and i.MX RT => Topic started by: johnr on August 28, 2007, 07:07:00 PM

Title: Source tree question
Post by: johnr on August 28, 2007, 07:07:00 PM
 I'm starting to study the source files and see references like

 #ifdef _M5223x , #ifdef  _CODE_WARRIOR_CF etc in config.h and other files
but can't find where these labels are defined. Am I missing something ?

 John
Title: Re: Source tree question
Post by: mark on August 28, 2007, 07:16:46 PM
Hi John

When working with the simulator (VS project) _M5223X is a pre-processor define in the project (see project->settings->C++->Pre-processor).

When compiling with a cross compiler the same define is set in the compiler set up in much the same way.

In the GCC project the _M5223X define is also a pre-processor define which is passed in the command line:
eg. (in make file)
Code: [Select]
Build\uTasker.o: ..\..\..\uTasker\uTasker.c $(DEPENDS)
m68k-elf-gcc -mcpu=52235 -Wall -Wstrict-prototypes -I..\..\uTaskerV1.3 -D _GNU -D _M5223X -g -c -Os ..\..\..\uTasker\uTasker.c -o Build\uTasker.o
-D _GNU and -D _M5223X are 2 pre-processor defines used to specify the processor and the fact that the code is being compiled for GNU.

The define _CODE_WARRIOR_CF is a pre-processor define which is delivered by the CodeWarrior compiler setup (as _GNU by the GCC) so that some low level stuff can be adapted to the specific compiler. This expains why you don't find any of these defines in any head files.

Regards

Mark