Announcements
IMPORTANT: Cypress Developer Community is transitioning on October 20th. To learn more and be prepared for this change, check out our latest announcement.
cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC Creator & Designer Software

HuEl_264296
New Contributor II

It's it possible for the code to find out the name of the build configuration that's being used. I know I can #ifdef NDEBUG to detect of this build is the debug one or not, but what if there was a third configuration. It's there some way the code could get the name of the configuration as a string. I.e "debug" or "release", etc.? Many thanks

0 Likes
1 Solution
Bob_Marlowe
Expert II

just use

   

#ifdef DEBUG

   

const char Configuration[] = "Debug";

   

#endif

   

 

   

Bob

View solution in original post

0 Likes
5 Replies
Bob_Marlowe
Expert II

When there will be a third configuration there will be a third name. But all that will not help you much: each of the parameters collected under a configuration can be changed without getting a note via a #defined value.

   

You may #define your own names for each configuration, there is room for that in the build settings.

   

 

   

Bob

0 Likes
HuEl_264296
New Contributor II
        The software doesn't need the know the particular settings. It just needs the name as a string so that I can ask the board at a later date which build it programmed with.   
0 Likes
Bob_Marlowe
Expert II

just use

   

#ifdef DEBUG

   

const char Configuration[] = "Debug";

   

#endif

   

 

   

Bob

View solution in original post

0 Likes
HuEl_264296
New Contributor II
        I already have that. And what if there's a third configuration?   
0 Likes
Bob_Marlowe
Expert II

Then the else-part will be executed. But as you know, there is no third configuration.

   

 

   

Bob