Rod Bristol

CodeWarrior 6.1 Go to macro declaration error

Discussion created by Rod Bristol on May 21, 2008
Latest reply on May 22, 2008 by Rod Bristol
When a macro is conditionally compiled and the file holding the declaration is not open, the right-click-and-Go-to-macro-declaration feature works correctly. If the file holding the macro is already open, the IDE chooses the last declaration in the file instead of the correct one. This is with the "Generate Browser Data From Compiler" option selected.
 
In my project, the compile switches are defined in a file set on a path unique to each target.
 
Here's an example:
/* active high relay control on port E */
#if(LocalRelayDrive == 1)
#define SetLocalRelayOn         PTED |= 1
#define SetLocalRelayOff        PTED &= ~0X01
#define GetLocalRelayStatus     (PTED & 1)
/* active low relay control on port E */
#elif(LocalRelayDrive == 0)
#define SetLocalRelayOff        PTED |= 1
#define SetLocalRelayOn         PTED &= ~0X01
#define GetLocalRelayStatus     (!(PTED & 1))
/* multiple relay control  on port B */
#elif(LocalRelayDrive == 3)
#define ShutdownRelayOff        PTBD |= (1<<2) // brown, shutdown
#define ShutdownRelayOn         PTBD &= ~(1<<2)
#define SetLocalRelayOff        PTBD &= ~(1<<1) // gray, short = setback
#define SetLocalRelayOn         PTBD |= (1<<1) // open = occupied
#endif
 
 
Thanks.
Rod Bristol
 

Outcomes