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.

TM4C123GH6PM: When in debug/release mode, how can I set a define in my code to flag it.

Part Number: TM4C123GH6PM

Tool/software:

Hello,

I have code such as:

#ifdef DEBUG
    char loginfo_buffer[128];
#endif

But I now want to switch it on and off using the debug configuration in the ccs. are there any flags that the debug configuration adds to code, or how can I make it such that the code knows whether at debug configuration or not.

Best Regards,

Can

  • Hi Can,

      In CCS, there are two default configuration: Debug and Release. 

    For your Debug configuration, you can add the DEBUG symbol to the 'Predefined Symbols' tab. Doing this will make your debug configuration with code that includes loginfo_buffer[128] and code that is surrounded by #ifdef DEBUG. For your Release configuration, you just don't add the DEBUG symbol and the Release build will not have code that is used for debugging.