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.

CCS 5.2 syntax highliting & macro expansion

Other Parts Discussed in Thread: MSP430F2618, MSP430F1611

I have a project part of which intended to compile on multiple platforms. I have custom platform.h file, where I define my own platform macro names, something like

#if defined(WIN32) || defined(_WINDOWS)
    #define _WIN32_            1
    #define _TMS320C62_        0
    #define _TMS320C6X_        0
    #define _TMS320C64X_     0
#elif defined(_TMS320C6X)
    #define _WIN32_            0
    #define _TMS320C6X_        1
    #if defined(_TMS320C6200)
        #define _TMS320C62_    1
    #endif
    #if defined(_TMS320C6400)
        #define _TMS320C64X_   1
    #endif
#else
    #define _WIN32_            0
    #define _TMS320C62_        0
    #define _TMS320C6X_        0
    #define _TMS320C64X_     0
#endif

If I edit this code in CCS 5.2 editor, code covered by _TMS320C64X_ is highlighted as inactive. Moreover, is I hover mouse pointer over that macro name, it is shown to have 0 value. If I go to its definition, I fall to the last "else" section of above code. As code compiles correctly, I think there is no problem with CGT itself, its rather editor presentation problem. Any ideas how to fix it?

Thanks.

  • The tooltip shows the text of the current line, it doesn't mean the marco _TMS320C64X_ has any value. Try hover between the first _TMS320C64X_ and the second _TMS320C64X_, the tooltip shows different text.

    Regards,
    Patrick 

  • Thanks for suggestion, but it does not work for me. Wherever I hover _TMS320C64X_ macro, tooltip shows 0. And as I mentioned, colouring of the code shows, that code covered by this macro is inactive. So what I am saying is that _TMS320C6X is defined by default in TI compilers, but syntax highlighter of CCS 5.2 does not recognize it to be defined. Since code compiles correct, I suspect the problem is with highlighter itself. Perhaps, it uses some general purpose parser, not TI's compiler.

  • Now that I kown _TMS320C6X is an internal macro defined by the compiler and looking at the CCS code, this macro is missing. I have filed a CQ for this defect.

     SDSCM00044475

    Regards,
    Patrick 

  • similar problems here.

    In the code below Code A is active even though __MSP430FG1611__ is not defined but __MSP430F2618__ is in the project properties and shows up in the command line as --define=__MSP430F2618__

    #if defined(__MSP430FG1611__) || (__TARGET_PROCESSOR==MSP430F1611)

    Code A

    #elif defined(__MSP430F2618__) || (__TARGET_PROCESSOR==MSP430F2618)

    Code B

    #else
     #error Target MCU is not supprted.
    #endif