Conditional Compilation Causes Peek Definition Issue

Hello,
IDE 2.3.4 Windows 11, building for STM32G4
I have a multi module project with .h files containing macros like below:
#define MOTOR_STOPPED 0

#define CHASSIS_NUMBER_OF_MOTORS 2
or
#define CHASSIS_NUMBER_OF_MOTORS 4
etc. etc.

In my .cpp files I use conditional compilation for Two a Four Motor build.
So either
#define CHASSIS_NUMBER_OF_MOTORS 2
or
#define CHASSIS_NUMBER_OF_MOTORS 4
Will be defined in one of the .h files.

Above the #if CHASSIS_NUMBER_OF_MOTORS == x Peek works just fine, but below the #endif Peek no longer pops up and say no definition if you use the right click menu.
Yet the code builds and runs correctly so obviously #if CHASSIS_NUMBER_OF_MOTORS == x is picking up the correct build.
Any ideas please? Many thanks in advance imk

Simple Example below:

Peek -> MOTOR_STOPPED works here

#if CHASSIS_NUMBER_OF_MOTORS == 2
blah
blah
#endif

#if CHASSIS_NUMBER_OF_MOTORS == 4
blah
blah
#endif

Peek -> MOTOR_STOPPED does not work here.

Not very clear to me. What says "no definition"? And osting just a "simple example" won't help much. Be more specific about the error, and add at least a few lines of code inside eache #if.

I think it's a known problem in IDE 2.x but I can't immediately find it back.

Problem Update: It has gone away as hovering mouse over a macro, procedure call , variable etc pops up its definition also right click Peek opens the edit peek window as normal.
So all working as expected. :slight_smile:

All I did was put PC into sleep mode (leaving IDE2 open in project), go for nice 40min walk in woods, bring PC out of sleep, listen to internet Radio 4 news, move mouse to IDE2 monitor and hover mouse over any project object and it works....

I didn't do anything other than put PC into sleep mode and wake it up again. :slight_smile:
Strange.....Do we have a Poltergeist?
IDE2 as wonderful as normal.... IMK

1 Like

Think this sounds like similar issue

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.