User manual

Table Of Contents
668
mikoC PRO for PIC32
MikroElektronika
Project Level Denes:
Project Level Denes (.pld) les can also be added to project. Project level dene les enable you to have denes that
are visible in all source les in the project. A le must contain one denition per line in the following form:
<symbol>=<value>
Dene a macro named symbol. To specify a value, use =<value>. If =<value> is omitted, 1 is assumed. Do not
enter white-space characters immediately before the “=”. If a white-space character is entered immediately after the
“=”, the macro is dened as zero token. This option can be specied repeatedly. Each appearance of symbol will be
replaced by the value before compilation.
For example, lets make a project level dene named pld_test. First of all, create a new le with the .pld extension,
pld_test_le.pld.
Next, open it, and write something like this:
pld_test=3
Once you have done this, save the le. In the Project Manager, add pld_test_le.pld le by right-clicking the
Project Level Denes node.
In the source code write the following:
#if pld_test == 3
...
#endif
There are number of predened project level denes. See predened project level denes
Note: For inclusion of the header les (extension .h), use the preprocessor directive #include. See File Inclusion for
more information.
Related topics: Project Manager, Project Settings, Edit Project