Why does a condition always evaluate to be true?
Hello everyone,
I have an issue regarding an always true condition produced by the following code.
Since I have never run into this kind of issue with C I guess it must have something to do with the STM environment.
The condition within the if-statement evaluates to always true, even if the values `new_distance` and `old_distance` are identical.
Please let me know your thoughts.
static uint32_t old_distance = 0;
uint32_t new_distance = distance_m;
if(new_distance != old_distance)
{
msg->hasEvent = 1;
}
old_distance = new_distance;Thanks!
