pud: move to stationary on undetermined moving state
authorFerry Huberts <ferry.huberts@pelagic.nl>
Thu, 28 Jul 2016 17:24:27 +0000 (19:24 +0200)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Fri, 29 Jul 2016 11:40:01 +0000 (13:40 +0200)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
lib/pud/src/state.c

index c2c6c84..5d91b5f 100644 (file)
@@ -129,8 +129,8 @@ void determineStateWithHysteresis(SubStateIndex subStateIndex, TristateBoolean m
        } else if (movingNow == TRISTATE_BOOLEAN_UNSET) {
                newState = MOVEMENT_STATE_STATIONARY;
        } else {
-               /* keep current sub-state */
-               newState = subState->internalState;
+               /* move to stationary */
+               newState = MOVEMENT_STATE_STATIONARY;
        }
        internalStateChange = (subState->internalState != newState);
        subState->internalState = newState;