altoslib: TeleMega telemetry pyro voltages are uint8
authorKeith Packard <keithp@keithp.com>
Sat, 30 Aug 2014 03:08:43 +0000 (22:08 -0500)
committerKeith Packard <keithp@keithp.com>
Sat, 30 Aug 2014 03:08:43 +0000 (22:08 -0500)
Using int8 means that voltages over about 6V are reported incorrectly.

Signed-off-by: Keith Packard <keithp@keithp.com>
altoslib/AltosTelemetryMegaData.java

index 8b1869bb65f3141fdc83a74496b97fdaa3fb0995..d949c02f3bc233fcc937e17150841f5184daf495 100644 (file)
@@ -36,7 +36,7 @@ public class AltosTelemetryMegaData extends AltosTelemetryStandard {
        public AltosTelemetryMegaData(int[] bytes) {
                super(bytes);
 
-               state = int8(5);
+               state = uint8(5);
 
                v_batt = int16(6);
                v_pyro = int16(8);
@@ -44,7 +44,7 @@ public class AltosTelemetryMegaData extends AltosTelemetryStandard {
                sense = new int[6];
 
                for (int i = 0; i < 6; i++) {
-                       sense[i] = int8(10 + i) << 4;
+                       sense[i] = uint8(10 + i) << 4;
                        sense[i] |= sense[i] >> 8;
                }