Hi,
Do you mean that the code inside the if is not executed, or that the debugger did not step to that line?
I ask because I have seen cases with compiler optimizations that the debugger did not stepped into the if, but the code was executed well.
So might try stepping with assembly stepping mode.
The other thing to check: are you using prototypes?
Is it like this:
float GetValue(void);
float Signal = GetValue(); // Signal = 0.6
if(Signal >= 0.5) // this compare not occured never
{
Signal += 0.1;
}
Then, if you have something like this:
float GetValue(void);
void foo(void) {
float Signal = GetValue(); // Signal = 0.6
if(Signal >= 0.5) // this compare not occured never
{
Signal += 0.1;
}
}
Then the compiler simply could remove the code (as not used/no side effect).
So it would be good if you could post an actual function or more details what you do?
I quickly tried your snippets with CodeWarrior MCU10.3 and gcc, and it works properly for me.
PS: as 0.6 is of type double, it would be good if you would change things to use the 'f' suffix to mark things of type float. E.g.
if (Signal>=0.5f)