What controls greyed out text in editor window?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

What controls greyed out text in editor window?

Jump to solution
1,157 Views
beng_
Contributor III

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.

error.png

Labels (1)
0 Kudos
1 Solution
948 Views
BlackNight
NXP Employee
NXP Employee

Hi Ben,

Eclipse uses the Index data base for this (it is a kind of data base). It could be that your database is not correct. And I recommend that you turn off heuristics. Have a read at Fixing the Eclipse Index | MCU on Eclipse  .

I hope this helps,

Erich

View solution in original post

2 Replies
948 Views
beng_
Contributor III

That's worked thanks

0 Kudos
949 Views
BlackNight
NXP Employee
NXP Employee

Hi Ben,

Eclipse uses the Index data base for this (it is a kind of data base). It could be that your database is not correct. And I recommend that you turn off heuristics. Have a read at Fixing the Eclipse Index | MCU on Eclipse  .

I hope this helps,

Erich