Macros that evaluate true are greyed out in editor (and vice versa)!

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

Macros that evaluate true are greyed out in editor (and vice versa)!

318 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jdupre on Tue Nov 26 11:11:12 MST 2013
I've got v6.1 and am working with the LPCOpen demo code.  In the editor, #if and #ifdef macros are not getting displayed correctly.  That is, some macros that evaluate true are greyed out, and macros that evaluate false are not greyed out.  It's just a display issue.  When I step through the code, the debugger will "step into" the greyed out sections.

How do I get the editor to recognize the macro definitions correctly?  

0 Kudos
4 Replies

310 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jdupre on Wed Nov 27 10:15:37 MST 2013
6.1.0_164 it says.

My workspace was created by importing LPCOpen 1.03.  I've simply built and stepped through some of the USB device and host examples on the EA 1788 dev board.

I'm going to set this up at home to see if I encounter the same issues.  It does appear to be only an indexer problem.  Code compiles and runs (mostly) as expected.
0 Kudos

310 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Wed Nov 27 01:33:03 MST 2013
Can you please let us know EXACTLY which LPCOpen you are using?

It would be even better if you could send us the whole workspace so that we can try to reproduce here.

Thanks
0 Kudos

310 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jdupre on Tue Nov 26 16:34:07 MST 2013
I reindexed all projects of LPCOpen, no change.

Here's another part of the problem:

Quote:

#if defined(USB_DEVICE_ONLY)
    #if !defined(USB_CAN_BE_DEVICE)
        #error USB_DEVICE_ONLY is not available for the currently selected microcontroller model.
    #else
        #undef USB_CAN_BE_HOST
        #undef USB_CAN_BE_BOTH
    #endif
#endif


For some reason the indexer thinks that USB_DEVICE_ONLY is defined, when it isn't.  (At least the compiler knows that its isn't.)  Because of that, the indexer also thinks that USB_CAN_BE_HOST is undefined.  If I comment out the #undefine, then everything looks right.

Question is, why does the indexer think that USB_DEVICE_ONLY is defined???  I can right click on it and ask for declarations, but it says none found in the workspace.
0 Kudos

310 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Tue Nov 26 13:55:46 MST 2013
Try rebuilding the index (right click on the project, Index->Rebuild).

Also check the indexer preferences (Preferences->C/C++->Indexer), in particular related to Build Config.

Regards,
LPCXpresso Support
0 Kudos