altos: Declare cc1111 accel_ref as unsigned so the math works 1.0.9.6
authorKeith Packard <keithp@keithp.com>
Fri, 29 Jun 2012 00:43:36 +0000 (17:43 -0700)
committerKeith Packard <keithp@keithp.com>
Fri, 29 Jun 2012 00:43:36 +0000 (17:43 -0700)
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 <keithp@keithp.com>
src/cc1111/ao_arch.h

index cece09ebbf14ce9989ae0b7c1bc219a4aa69169d..8d9e49529769fc9bdf6836a731380c6ca7d96a96 100644 (file)
@@ -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
 };