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/MSP430FR6043: Calculation part of internal ADC in SDHS module in USS.

Part Number: MSP430FR6043

Tool/software: Code Composer Studio

Hello,

i can't understand following code lines, im littele bit confuse, can anyone explain this code lines

#if defined(__TI_COMPILER_VERSION__)
#pragma DATA_SECTION(results, ".leaRAM")
#pragma RETAIN(results)
unsigned int results[1024] = {0};
#elif defined(__IAR_SYSTEMS_ICC__)
#pragma location=0x5000
__no_init unsigned int results[1024];
#pragma required = results
#else
#error Compiler not supported!
#endif

  • SUMIT SIRMEWAR said:
    #if defined(__TI_COMPILER_VERSION__)

    The preprocessor symbol __TI_COMPILER_VERSION__ is predefined by the TI MSP430 compiler.  So this is the same as saying if the TI compiler is being used.

    SUMIT SIRMEWAR said:
    #pragma DATA_SECTION(results, ".leaRAM")
    #pragma RETAIN(results)

    Please search for those pragmas in the TI MSP430 compiler manual.  Briefly, DATA_SECTION names the section the variable (results in this case) resides in.  RETAIN says to keep the variable even if it is never referenced.

    The next few lines are for the IAR MSP430 compiler.  I'm not familiar with that compiler.  But I'm sure this line ...

    SUMIT SIRMEWAR said:
    #elif defined(__IAR_SYSTEMS_ICC__)

    ... identifies use of the IAR compiler.  

    As for these lines ...

    SUMIT SIRMEWAR said:
    #else
    #error Compiler not supported!
    #endif

    If neither the TI compiler or IAR compiler are being used, then issue an error diagnostic that says: Compiler not supported!

    Thanks and regards,

    -George

**Attention** This is a public forum