Avoid 16-bit overflow in velocity computation.
authorKeith Packard <keithp@keithp.com>
Sun, 24 May 2009 04:16:22 +0000 (21:16 -0700)
committerKeith Packard <keithp@keithp.com>
Sun, 24 May 2009 04:16:22 +0000 (21:16 -0700)
commitd6f5a0689023546464a71561f53fa2c943077c88
tree48fd63d1c4c381b6ec574575eb147473ec2ad424
parentaa6d87aeb616dd62f0debaded297232022b4f8bd
Avoid 16-bit overflow in velocity computation.

Adding two 16 bit integers together can wrap around to negative numbers,
this resulted in velocity values which never decreased, making the switch
from coast to apogee state not occur.

Signed-off-by: Keith Packard <keithp@keithp.com>
ao_flight.c