From: Keith Packard Date: Fri, 29 Jun 2012 00:43:36 +0000 (-0700) Subject: altos: Declare cc1111 accel_ref as unsigned so the math works X-Git-Tag: 1.0.9.6^0 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=edbc5d27c8c2936b59ff5289276d9198b501ebc8 altos: Declare cc1111 accel_ref as unsigned so the math works If accel_ref is signed, then the careful shifting and dividing dance necessary to correct for changes in the relationship between the 5V and 3.3V supplies always generates zero. Signed-off-by: Keith Packard --- diff --git a/src/cc1111/ao_arch.h b/src/cc1111/ao_arch.h index cece09eb..8d9e4952 100644 --- a/src/cc1111/ao_arch.h +++ b/src/cc1111/ao_arch.h @@ -206,7 +206,7 @@ struct ao_adc { int16_t sense_d; /* drogue continuity sense */ int16_t sense_m; /* main continuity sense */ #if HAS_ACCEL_REF - int16_t accel_ref; /* acceleration reference */ + uint16_t accel_ref; /* acceleration reference */ #endif };