altos: Perform time comparisons using 16-bit arithmetic to handle wrap
authorKeith Packard <keithp@keithp.com>
Thu, 24 Aug 2017 23:45:54 +0000 (16:45 -0700)
committerKeith Packard <keithp@keithp.com>
Mon, 28 Aug 2017 00:38:58 +0000 (17:38 -0700)
commitcf20e213f39fb24f15e0ac94307c2d138fcadecb
tree49914763b691edb7164c762a49798294ad9c4350
parent43e2275250d9c91560a770942f3c06a8f74ed501
altos: Perform time comparisons using 16-bit arithmetic to handle wrap

Subtracting two 16-bit unsigned values to perform time comparisons
yields mystic results unless we carefully cast that to int16_t.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/kernel/ao_flight.c
src/kernel/ao_kalman.c
src/kernel/ao_sample.c