Skip to content
Snippets Groups Projects
Commit 66b1b71a authored by Pascal Engeler's avatar Pascal Engeler
Browse files

Fixed boolean bug, fixed number of states

parent 4fa925a0
No related branches found
No related tags found
1 merge request!2Resolve "Distance wrapping invalidates lock sum"
...@@ -33,7 +33,7 @@ end DistanceUnwrapper; ...@@ -33,7 +33,7 @@ end DistanceUnwrapper;
architecture Behavioral of DistanceUnwrapper is architecture Behavioral of DistanceUnwrapper is
type STATE_T is (IDLE_S, STATE1, STATE2, STATE3, STATE4, STATE5, STATE6); type STATE_T is (IDLE_S, STATE1, STATE2, STATE3);
signal current_state : STATE_T := IDLE_S; signal current_state : STATE_T := IDLE_S;
...@@ -102,7 +102,7 @@ begin ...@@ -102,7 +102,7 @@ begin
--calculate change to offset here --calculate change to offset here
if calcDelta > maxDelta then if calcDelta > maxDelta then
--we have wrapped around --we have wrapped around
if newIsLarger then if newIsLarger = '1' then
--went negative --went negative
currentOffset <= currentOffset + corrDeltaN; currentOffset <= currentOffset + corrDeltaN;
else else
...@@ -116,7 +116,7 @@ begin ...@@ -116,7 +116,7 @@ begin
newIsLarger <= newIsLarger; newIsLarger <= newIsLarger;
calcDelta <= calcDelta; calcDelta <= calcDelta;
currentDistance <= currentDistance; currentDistance <= currentDistance;
dr_out <= dr_out; dr_out <= '0';
prevDistance <= prevDistance; prevDistance <= prevDistance;
when STATE2 => when STATE2 =>
...@@ -127,7 +127,7 @@ begin ...@@ -127,7 +127,7 @@ begin
newIsLarger <= newIsLarger; newIsLarger <= newIsLarger;
calcDelta <= calcDelta; calcDelta <= calcDelta;
currentOffset <= currentOffset; currentOffset <= currentOffset;
dr_out <= dr_out; dr_out <= '0';
prevDistance <= latchedDistance; prevDistance <= latchedDistance;
when STATE3 => when STATE3 =>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment