What controls greyed out text in editor window?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

What controls greyed out text in editor window?

ソリューションへジャンプ
1,994件の閲覧回数
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,785件の閲覧回数
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,785件の閲覧回数
beng_
Contributor III

That's worked thanks

0 件の賞賛
返信
1,786件の閲覧回数
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