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.

.dat files and preprocessor directives

Other Parts Discussed in Thread: SIMPLICITI, CC1101

Hi,

I have a problem (maybe it is not a problem) with .dat files in SimpliciTI RF stack. These .dat files are used for build configuration of this stack. For example:

# Define Frequency Agility as active for this build
--define=FREQUENCY_AGILITY
# Enable application autoacknowledge support. Requires extended API as well
--define=APP_AUTO_ACK

It means that FREQUENCY_AGILITY and APP_AUTO_ACK are defined. It is ok and I understand.

BUT. I show you a piece of application program for better understanding:

As you can see... in application program it seems that FREQUENCY_AGILITY is not defined because #ifdef - #endif directive is highlighted. But FREQUENCY_AGILITY is really defined - it must be, because if I insert "#" before --define=FREQUENCY_AGILITY in .dat file I get an error after build.

Is my problem with this linker or compilator setting issue? I tried to find any information in project settings, but without succes. Thank you very much.

Maros.

  • This is more of  a CCS editor issue rather than a compiler issue. Which exact version of CCS are you using?

    Also can you provide the link to the software package you are working with so we can see if we can duplicate the behavior?

  • Thank you for your response.

    I'm using CCS 5.3.0 and it is SimpliciTI stack which you can find here: http://www.ti.com/tool/simpliciti

    1. I save this package on D:\RF SimpliciTI

    2. Open CCS and set my workspace on D:\MSP430 - maybe this I'm doing wrong..

    3. Project -> import CCS project -> D:\RF simpliciTI\Projects\Examples\EXP461x\AP_as_Data_Hub

    4. In properties -> general -> manage configuration -> CC1101 - AccessPoint

    5. Then I go to properties -> resource -> linked resources -> new -> name: DEV_ROOT and path is D:\RF simpliciTI.

    6. Build

    7. In project path you can see folder Applications and then application -> Access point -> main_AP_Async_Listen_autoack.c

    8. In project path you can see folder Applications and then configuration -> access point -> smpl_config.dat and in the configuration folder you can find smpl_nwk_config.dat

    Picture I posted here is from main_AP_Async_Listen_autoack.c and .dat code is from smpl_nwk_config.dat

    Thank you!

  • The reason for the behavior you are seeing is that these defines (for example,  FREQUENCY_AGILITY) are coming from an options file (in this case, smpl_nwk_config.dat) which directly gets passed to the compiler. The files are currently not scanned and interpreted by the build system, so the editor is not aware of the --define options, hence does not display the conditional formatting.

    We have an enhancement filed in our database for CCS to be able to scan and track the defines coming from an options file. Please see this related thread and tracking number.

  • So I have to wait until CCS 6.0.0 will be released... because I know its just a cosmetic issue but in a big project its very important for better code reading and understanding.

    Thank you

  • Unfortunately, yes you would need to wait until 6.0 if you want the functionality when reading those options from an options file.

    For now, you could modify the project to add those --defines to the compiler options directly (from Project Properties->Build->Compiler) rather than reading them from an options file.