AnsweredAssumed Answered

What controls greyed out text in editor window?

Question asked by Ben Griffiths on Aug 29, 2017
Latest reply on Aug 30, 2017 by Ben Griffiths

I have a pre-processor if/else statement and which text is greyed out doesn't seem to change based upon my project options.

 

E.g.

#if defined HIGH_POWER_BOARD

 some_function();

#elif defined LOW_POWER_BOARD

  another_function();

#else

 #error Board Type needs defining

#endif

 

In my project options I have two configurations defined ( Project /Properties / C/C++ Build / Configuration ) - High Power Config & Low Power Config.

 

In defined symbols I have (Project /Properties / C/C++ Build / Settings / Tool Settings / Cross ARM C Compiler / Preprocessor / Defined Symbols ) I have defined HIGH_POWER_BOARD for High Power Config and LOW_POWER_BOARD. for Low Power Config.

 

When High Power Config is active 2nd & 3rd blocks above are greyed out and the 1st block of code is the code that's compiled.

 

So when I have the Low Power Config active I'd expect the 1st & 3rd blocks above to be greyed out with the 2nd block compiled. The 2nd block (another_function()) is the code that's compiled and active, however it's still the 2nd and 3rd block that's greyed out.

 

Basically the correct code is compiled/included however the incorrect code is greyed out.

 

I've attached a screenshot below showing an example from my code.

Outcomes