This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

use of --undefine in CCS12

Hi there,

I have a CSL installation for which the csl_general.h has the following definition :

/** ***************************************************************************
 * --------------------------------------------------
 * PART1: CHIP VERSION MACRO DEFINITION FOR PG2.1 CSL
 * --------------------------------------------------
 *
 * Below macros are used to enable the source code specific to chip version
 * TMS320C5517.
 *
 * 'CHIP_C5517' indicates TMS320C5517 DSP.
 *
 * Defining the macro below will enable the code for the DSP TMS320C5517.
 */

/* TMS320C5517 */
#define CHIP_C5517

...
..
..

I would like to "undefine" this #define CHIP_C5517 macro directly somewhere in the CCS12 project environment variables if possible.

Is there a way to undefine this macro/symbol so that at project compilation the correct code is compiled automatically (that is the one that is not for the C5517) ?

There is not much in the CCS user guide about this...

thanks in advance, mike

  • I would like to "undefine" this #define CHIP_C5517 macro directly somewhere in the CCS12 project environment variables if possible.

    I don't think that's possible for macros defined in your source code.

  • So I would have to manually comment-out this macro in the .h file(s) ?

  • Yes, or alternatively, where you #include "csl_general.h" you could then #undef CHIP_C5517.

  • This seems like it would do the trick, but I have just tried it out and it breaks the compilation. I tried both before the #include and immediately after, but the macro is probably undefined later, after the wrong code was included in the compilation ...

    I think this would work as long as the #undef is in the same csl_general.h source file where all the conditional code compilation is determined ...

    I was hoping I could do like a "global" undefine so as to switch the macro off before compilation starts, and this would then compile the correct code for my platform ... but alas it is not a major problem to lose sleep over ;-)

  • I would like to "undefine" this #define CHIP_C5517 macro directly somewhere in the CCS12 project environment variables if possible.

    It possible to add the compiler build option --undefine=CHIP_C5517, and build every file with that setting.  However, that does not have the effect you want.  Because the compiler sees the compiler option first, then the source line ...

    #define CHIP_C5517

    The setting from the source overrides the setting from the command line.  

    Thus, the only way to ...

    "undefine" this #define CHIP_C5517 macro

    ... is to change the source code.

    Thanks and regards,

    -George