Skip to content

Commit

Permalink
Merge pull request #6602 from shellixyz/fix/logic_condition_vspeed_co…
Browse files Browse the repository at this point in the history
…nstrain

Fix logic condition VSpeed constraint not allowing the value to be negative
  • Loading branch information
DzikuVx authored Feb 23, 2021
2 parents ea756aa + 282c3b1 commit 0a284d3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/programming/logic_condition.c
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ static int logicConditionGetFlightOperandValue(int operand) {
break;

case LOGIC_CONDITION_OPERAND_FLIGHT_VERTICAL_SPEED: // cm/s
return constrain(getEstimatedActualVelocity(Z), 0, INT16_MAX);
return constrain(getEstimatedActualVelocity(Z), INT16_MIN, INT16_MAX);
break;

case LOGIC_CONDITION_OPERAND_FLIGHT_TROTTLE_POS: // %
Expand Down

0 comments on commit 0a284d3

Please sign in to comment.