What controls greyed out text in editor window?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

What controls greyed out text in editor window?

跳至解决方案
2,002 次查看
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

标签 (1)
标记 (2)
0 项奖励
回复
1 解答
1,793 次查看
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

在原帖中查看解决方案

2 回复数
1,793 次查看
beng_
Contributor III

That's worked thanks

0 项奖励
回复
1,794 次查看
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