Using preprocessor directive
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-10-01 5:11 AM
Posted on October 01, 2015 at 14:11
Hello,
I want to use a pre-processor directive for conditional compilation.I have a piece of code which I want to include when a pre-processor directive is defined. Where to define this in SPC5Studio? Which settings are required for this?
Thanks in advance for your reply.
Mike.
This discussion is locked. Please start a new topic to ask your question.
3 REPLIES 3
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-10-01 7:38 AM
Posted on October 01, 2015 at 16:38
Hello Mike ,
You can define in the Platform component by -D<DIRECTIVE_NAME> in CPP options Best regards ErwanOptions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-10-05 4:32 AM
Posted on October 05, 2015 at 13:32
1. I tried using the -D under cpp options. I wrote -D PASS1 and my code contains following statement,
#if defined(PASS1)#define Toggle_Pin() palTogglePad(PORT_B, TICK);#endifWith above option, I am expecting the above code should get enabled when I debug it. But I see that this part of code is disabled as it is not getting the required macro definition. Can you please clarify how to achieve this?2. Which document/user guide has this information listed for different build or runtime settings?Thanks.Mike.Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-10-06 2:36 AM
Posted on October 06, 2015 at 11:36 Hello Mike , CPP Options is for C++ Compiler C options is for C Compiler please use C Option , generate, and compiler the different build / runtime settings are described in SPC5 Property description SPC5studio is using the hightec compiler there are several documents in this directory c:\SPC5Studio\eclipse\plugins\com.st.tools.spc5.tools.hightec.win32_1.0.0.201306281422\hightec\docs\ Best regards Erwan
________________
Attachments : 2015-10-06_113313.png : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Htf0&d=%2Fa%2F0X0000000aVU%2FaH6hXC2Y6vhF0xoAJONryCd6ndbHQy_R7r0w9TSKU0s&asPdf=false
